npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2025 – Pkg Stats / Ryan Hefner

@willh/azure-tts

v1.0.0

Published

A small CLI to convert text to speech using Azure OpenAI gpt-audio-mini (WAV output)

Readme

Azure TTS CLI

一個使用 Azure OpenAI gpt-audio-mini 將文字轉成 WAV 音訊的 CLI 套件。

安裝

# 全域安裝
npm install --global @willh/azure-tts

# 或作為開發依賴安裝(在本地專案執行):
npm install

使用範例

  • 使用 Azure Key (環境變數形式):

    set AZURE_OPENAI_ENDPOINT=https://<your-resource>.openai.azure.com
    set AZURE_OPENAI_API_KEY=<your-api-key>
    node index.js --file tests/sample.txt
  • 使用命令列覆寫 API key /endpoint:

    node index.js --file tests/sample.txt --api-key "<your-api-key>" --endpoint "https://<your-resource>.openai.azure.com"
  • 如果沒有 Azure 帳號或不想使用網路呼叫,請使用模擬輸出模式:

    node index.js --file tests/sample.txt --mock

參數

  • -f, --file:從檔案讀取文字
  • -t, --text:直接傳入文字
  • -o, --output:指定輸出檔(預設 output.wav
  • -v, --voice:語音選項(例如 alloy、echo、fable、onyx、nova、shimmer)
  • --mock:產生靜音 WAV(便於測試)

測試

npm test

發佈

自動化發佈與建立 GitHub Release 請參閱 PUBLISHING.md

授權

MIT

本專案包含 GitHub Actions workflow(.github/workflows/publish.yml),會在標籤(tag)或 release 時自動執行測試並發佈到 npm。詳見 PUBLISHING.md

授權

MIT

注意

  • 若同時設定 AZURE_OPENAI_API_KEY 與 Azure AD 驗證 (Keyless),程式會優先使用 API key。

  • --no-open 參數可禁止程式在處理完後自動使用系統預設應用程式開啟產生的音訊檔 (Windows 上使用 start)

發現

  1. 他不會真的照輸入的文字唸稿,而是會在理解上下文之後,重新用新的字詞唸出來。