{"id":23318552,"url":"https://github.com/ericc-ch/edge-tts","last_synced_at":"2025-08-22T17:31:26.426Z","repository":{"id":254423613,"uuid":"846462355","full_name":"ericc-ch/edge-tts","owner":"ericc-ch","description":"Use Microsoft Edge's online text-to-speech service from JS code directly!","archived":false,"fork":false,"pushed_at":"2025-02-07T14:00:01.000Z","size":237,"stargazers_count":12,"open_issues_count":1,"forks_count":4,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-04-09T09:51:43.028Z","etag":null,"topics":["reverse-engineering","tts"],"latest_commit_sha":null,"homepage":"https://npm.im/@echristian/edge-tts","language":"TypeScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mpl-2.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/ericc-ch.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2024-08-23T09:04:41.000Z","updated_at":"2025-03-25T17:39:16.000Z","dependencies_parsed_at":"2024-08-23T11:38:03.525Z","dependency_job_id":"ded6695a-9f9a-4706-8611-5800cbc54a7a","html_url":"https://github.com/ericc-ch/edge-tts","commit_stats":null,"previous_names":["ericc-ch/edge-tts"],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/ericc-ch/edge-tts","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ericc-ch%2Fedge-tts","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ericc-ch%2Fedge-tts/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ericc-ch%2Fedge-tts/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ericc-ch%2Fedge-tts/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/ericc-ch","download_url":"https://codeload.github.com/ericc-ch/edge-tts/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ericc-ch%2Fedge-tts/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":271673564,"owners_count":24800717,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","status":"online","status_checked_at":"2025-08-22T02:00:08.480Z","response_time":65,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["reverse-engineering","tts"],"created_at":"2024-12-20T17:17:24.398Z","updated_at":"2025-08-22T17:31:26.417Z","avatar_url":"https://github.com/ericc-ch.png","language":"TypeScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Edge TTS\n\n\u003e A TypeScript library for generating speech using Microsoft Edge's text-to-speech API\n\nGenerate speech from text using Microsoft Edge's text-to-speech service. This library provides access to Edge's TTS capabilities with subtitle generation support and voice customization options.\n\n## Installation\n\n```bash\nnpm install @echristian/edge-tts\n```\n\n## CLI Usage\n\n```bash\n# List all available voices grouped by locale\nnpx @echristian/edge-tts voices\n\n# Generate audio from text\nnpx @echristian/edge-tts synthesize \"Hello world\" --audio output.mp3 --voice en-US-AvaNeural\n\n# Generate audio with subtitles\nnpx @echristian/edge-tts synthesize \"Hello world\" --audio output.mp3 --subtitle output.srt --voice en-US-AvaNeural\n```\n\n## API Usage\n\n```typescript\nimport { synthesize, synthesizeStream, getVoices } from \"@echristian/edge-tts\";\n\n// Get available voices\nconst voices = await getVoices();\nconsole.log(voices); // Array of available voice options\n\n// Basic usage with synthesize()\nconst { audio, subtitle } = await synthesize({\n  text: \"Hello, world!\",\n});\n\n// Stream processing usage\nconst generator = synthesizeStream({ text: \"Hello world\" });\nfor await (const chunk of generator) {\n  // chunk is a Uint8Array of raw audio data\n  // Process or save each chunk as needed\n}\n\n// Collecting all streamed chunks\nconst chunks: Uint8Array[] = [];\nfor await (const chunk of synthesizeStream({ text: \"Hello world\" })) {\n  chunks.push(chunk);\n}\n```\n\n## API\n\n### getVoices(): Promise\u003cArray\u003cVoice\u003e\u003e\n\nReturns an array of available voices with their properties.\n\n#### Voice Object\n\n| Property     | Type   | Description                    |\n| ------------ | ------ | ------------------------------ |\n| Name         | string | Full name of the voice         |\n| ShortName    | string | Short identifier for the voice |\n| Gender       | string | Voice gender (Male/Female)     |\n| Locale       | string | Language code and region       |\n| FriendlyName | string | Display name for the voice     |\n\n### synthesize(options): Promise\u003cGenerateResult\u003e\n\nMain function to generate speech from text.\n\n### synthesizeStream(options): AsyncGenerator\u003cUint8Array\u003e\n\nCreates an async generator that yields chunks of processed audio data. Each chunk has metadata headers automatically removed.\n\nUses the same options as `synthesize()`, but without subtitle support:\n\n| Option       | Type   | Default                           | Description               |\n| ------------ | ------ | --------------------------------- | ------------------------- |\n| text         | string | (required)                        | Text to convert to speech |\n| voice        | string | \"en-US-AvaNeural\"                 | Voice ID to use           |\n| language     | string | \"en-US\"                           | Language code             |\n| outputFormat | string | \"audio-24khz-96kbitrate-mono-mp3\" | Audio format              |\n| rate         | string | \"default\"                         | Speaking rate             |\n| pitch        | string | \"default\"                         | Voice pitch               |\n| volume       | string | \"default\"                         | Audio volume              |\n\nFor detailed configuration options, refer to Microsoft's documentation:\n\n- [Available voices and language support](https://learn.microsoft.com/en-us/azure/ai-services/speech-service/language-support?tabs=tts)\n- [Audio output formats](https://learn.microsoft.com/en-us/dotnet/api/microsoft.cognitiveservices.speech.speechsynthesisoutputformat?view=azure-dotnet)\n- [Pitch, rate, and volumes](https://learn.microsoft.com/en-us/azure/ai-services/speech-service/speech-synthesis-markup-voice)\n\nNote: Some options may be limited by Microsoft Edge's service capabilities.\n\n#### GenerateOptions\n\n| Option       | Type            | Default                              | Description               |\n| ------------ | --------------- | ------------------------------------ | ------------------------- |\n| text         | string          | (required)                           | Text to convert to speech |\n| voice        | string          | \"en-US-AvaNeural\"                    | Voice ID to use           |\n| language     | string          | \"en-US\"                              | Language code             |\n| outputFormat | string          | \"audio-24khz-96kbitrate-mono-mp3\"    | Audio format              |\n| rate         | string          | \"default\"                            | Speaking rate             |\n| pitch        | string          | \"default\"                            | Voice pitch               |\n| volume       | string          | \"default\"                            | Audio volume              |\n| subtitle     | SubtitleOptions | { splitBy: \"word\", wordsPerCue: 10 } | Subtitle options          |\n\n#### SubtitleOptions\n\n| Option         | Type                 | Default | Description                          |\n| -------------- | -------------------- | ------- | ------------------------------------ |\n| splitBy        | \"word\" \\| \"duration\" | \"word\"  | How to split subtitles               |\n| wordsPerCue    | number               | 10      | Words per subtitle when using 'word' |\n| durationPerCue | number               | 5000    | Duration (ms) when using 'duration'  |\n\n#### GenerateResult\n\n| Property | Type                  | Description          |\n| -------- | --------------------- | -------------------- |\n| audio    | Blob                  | Generated audio data |\n| subtitle | Array\u003cSubtitleResult\u003e | Generated subtitles  |\n\n#### SubtitleResult\n\n| Property | Type   | Description     |\n| -------- | ------ | --------------- |\n| text     | string | Subtitle text   |\n| start    | number | Start time (ms) |\n| end      | number | End time (ms)   |\n| duration | number | Duration (ms)   |\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fericc-ch%2Fedge-tts","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fericc-ch%2Fedge-tts","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fericc-ch%2Fedge-tts/lists"}