{"_id":"@bestcodes/edge-tts","_rev":"6-37a1bbf141cd33ccb048923c9580fefc","name":"@bestcodes/edge-tts","dist-tags":{"latest":"3.0.1"},"versions":{"1.0.1":{"name":"@bestcodes/edge-tts","version":"1.0.1","keywords":["tts","text-to-speech","speech","text","voice","ssml","azure","speech-synthesis","readaloud","edge","microsoft"],"author":{"name":"The-Best-Codes"},"license":"MIT","_id":"@bestcodes/edge-tts@1.0.1","maintainers":[{"name":"bestcodes","email":"bestcodes.official@gmail.com"}],"homepage":"https://github.com/The-Best-Codes/edge-tts#readme","bugs":{"url":"https://github.com/The-Best-Codes/edge-tts/issues"},"dist":{"shasum":"6764c75a5bb693e2c0269292e42f54b933b32912","tarball":"https://registry.npmjs.org/@bestcodes/edge-tts/-/edge-tts-1.0.1.tgz","fileCount":15,"integrity":"sha512-Tq4K3UMZsqkjYSgQ9O5EDkhJH3nmVsPbVPVBtolCcDZ/LqcXmqCanTYMphgCW6CgipOl8xiYSGqy/mm7sHSlag==","signatures":[{"sig":"MEUCIGEb0E0e383rbuhIg9lgfUsy2YvdiYYlKUkqCpHMuWcRAiEAnweCGyEu5HF/QZH/uBz3xWxN5m2WligU/u2syYAam3U=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":26958},"main":"./dist/index","module":"./dist/index","gitHead":"a0f058706b9758539fd1d1175419c65e65b041c9","scripts":{"build":"tsc --project tsconfig.json --outDir dist && npm run minify","minify":"find dist/ -name '*.js' -type f -exec terser {} --compress --mangle --output {} \\;","update":"npm update --save && npm update --save-dev && npx npm-check-updates@latest -u && npm install","depclean":"sh depclean.sh","maintain":"npm run depclean && npm run update","prepublishOnly":"npm run build"},"_npmUser":{"name":"bestcodes","email":"bestcodes.official@gmail.com"},"repository":{"url":"git+https://github.com/The-Best-Codes/edge-tts.git","type":"git"},"_npmVersion":"10.8.2","description":"An Azure Speech Service module that uses the Microsoft Edge Read Aloud API.","directories":{},"_nodeVersion":"20.18.0","_hasShrinkwrap":false,"devDependencies":{"axios":"^1.7.7","buffer":"^6.0.3","terser":"^5.36.0","@types/node":"^22.8.1","randombytes":"^2.1.0","isomorphic-ws":"^5.0.0","@types/randombytes":"^2.0.3"},"_npmOperationalInternal":{"tmp":"tmp/edge-tts_1.0.1_1729895611606_0.4421190357743958","host":"s3://npm-registry-packages"}},"1.0.2":{"name":"@bestcodes/edge-tts","version":"1.0.2","keywords":["tts","text-to-speech","speech","text","voice","ssml","azure","speech-synthesis","readaloud","edge","microsoft"],"author":{"name":"The-Best-Codes"},"license":"MIT","_id":"@bestcodes/edge-tts@1.0.2","maintainers":[{"name":"bestcodes","email":"bestcodes.official@gmail.com"}],"homepage":"https://github.com/The-Best-Codes/edge-tts#readme","bugs":{"url":"https://github.com/The-Best-Codes/edge-tts/issues"},"dist":{"shasum":"42e1326299d64e7fe5295fbe8b97afc319d6af24","tarball":"https://registry.npmjs.org/@bestcodes/edge-tts/-/edge-tts-1.0.2.tgz","fileCount":15,"integrity":"sha512-d1Je+hZ4axesZ1TsEUiMc4nPdsa1wsiLy3FLgJITpCNqN3JqP+/Ut5hiNpy731jtZoM2YL53tovmS3RpN0E2YQ==","signatures":[{"sig":"MEUCIE6EcJZ1TjvEOw8FQpcDue/M4/gj4KQ5mx4ySiBqhGqAAiEAtk8BR6rvItTB1RI67hwbWY1J2jgTH9IE3yzteQ1nFxs=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":27031},"main":"./dist/index","module":"./dist/index","gitHead":"48e440f0b4d10bbece82a08585b08d6e089eec40","scripts":{"build":"tsc --project tsconfig.json --outDir dist && npm run minify","minify":"find dist/ -name '*.js' -type f -exec terser {} --compress --mangle --output {} \\;","update":"npm update --save && npm update --save-dev && npx npm-check-updates@latest -u && npm install","depclean":"sh depclean.sh","maintain":"npm run depclean && npm run update","prepublishOnly":"npm run build"},"_npmUser":{"name":"bestcodes","email":"bestcodes.official@gmail.com"},"repository":{"url":"git+https://github.com/The-Best-Codes/edge-tts.git","type":"git"},"_npmVersion":"6.14.18","description":"An Azure Speech Service module that uses the Microsoft Edge Read Aloud API.","directories":{},"_nodeVersion":"14.21.3","_hasShrinkwrap":false,"devDependencies":{"axios":"^1.7.7","buffer":"^6.0.3","terser":"^5.36.0","@types/node":"^22.8.1","randombytes":"^2.1.0","isomorphic-ws":"^5.0.0","@types/randombytes":"^2.0.3"},"_npmOperationalInternal":{"tmp":"tmp/edge-tts_1.0.2_1729895690049_0.44069044907085964","host":"s3://npm-registry-packages"}},"1.0.3":{"name":"@bestcodes/edge-tts","version":"1.0.3","keywords":["tts","text-to-speech","speech","text","voice","ssml","azure","speech-synthesis","readaloud","edge","microsoft"],"author":{"name":"The-Best-Codes"},"license":"MIT","_id":"@bestcodes/edge-tts@1.0.3","maintainers":[{"name":"bestcodes","email":"bestcodes.official@gmail.com"}],"homepage":"https://github.com/The-Best-Codes/edge-tts#readme","bugs":{"url":"https://github.com/The-Best-Codes/edge-tts/issues"},"dist":{"shasum":"c1488965e88b858b2f4b1defddaace808b251c3b","tarball":"https://registry.npmjs.org/@bestcodes/edge-tts/-/edge-tts-1.0.3.tgz","fileCount":15,"integrity":"sha512-sxHrE4ZJUppZN6S9li6ubUZkWPudGDByjUrohYuwQtcLt411gpv/4roAZlQa1C0Qvwo/rE826wWRMeVRAEPqYA==","signatures":[{"sig":"MEQCIDAN6TgCBBnFBEg4u48/JA0EDx5Uok1jsxd3O09FTQveAiBfl0Lyc1UC4AM/2A0/PYIJV6I2ia7N1EWJtLP07uXO3A==","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":27118},"main":"./dist/index","module":"./dist/index","gitHead":"39c4c349c0508ad9db3d2be97c013fe4e68b4911","scripts":{"build":"tsc --project tsconfig.json --outDir dist && npm run minify","minify":"find dist/ -name '*.js' -type f -exec terser {} --compress --mangle --output {} \\;","update":"npm update --save && npm update --save-dev && npx npm-check-updates@latest -u && npm install","depclean":"sh depclean.sh","maintain":"npm run depclean && npm run update","prepublishOnly":"npm run build"},"_npmUser":{"name":"bestcodes","email":"bestcodes.official@gmail.com"},"repository":{"url":"git+https://github.com/The-Best-Codes/edge-tts.git","type":"git"},"_npmVersion":"6.14.18","description":"An Azure Speech Service module that uses the Microsoft Edge Read Aloud API.","directories":{},"_nodeVersion":"14.21.3","_hasShrinkwrap":false,"devDependencies":{"axios":"^1.7.7","buffer":"^6.0.3","terser":"^5.36.0","@types/node":"^22.8.1","randombytes":"^2.1.0","isomorphic-ws":"^5.0.0","@types/randombytes":"^2.0.3"},"_npmOperationalInternal":{"tmp":"tmp/edge-tts_1.0.3_1729896547454_0.4036686177348794","host":"s3://npm-registry-packages"}},"2.0.0":{"name":"@bestcodes/edge-tts","version":"2.0.0","keywords":["tts","text to speech","speech","edge","edgetts"],"author":{"url":"https://bestcodes.dev","name":"The-Best-Codes"},"license":"MIT","_id":"@bestcodes/edge-tts@2.0.0","maintainers":[{"name":"bestcodes","email":"bestcodes.official@gmail.com"}],"homepage":"https://github.com/The-Best-Codes/edge-tts","bugs":{"url":"https://github.com/The-Best-Codes/edge-tts/issues"},"dist":{"shasum":"bac1443af5e1105ad2d712329368e67275bd233c","tarball":"https://registry.npmjs.org/@bestcodes/edge-tts/-/edge-tts-2.0.0.tgz","fileCount":4,"integrity":"sha512-TENcUsQH0hMeSUhOc1vTpkyL6hWZnbvZGE1RKcIRwNm6RqY9gWCDfUhHZDnoXuQdav7I8idANyJHcwEyteTehg==","signatures":[{"sig":"MEUCIQCnXdug+ZAHRUUQgCPIpQbHT+W7KnNW0eXxdI+9GP19yQIgMz2IfxmqjyS3e85hFurvH/MZL4oxhFrmsA5nV1S4dtM=","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"attestations":{"url":"https://registry.npmjs.org/-/npm/v1/attestations/@bestcodes%2fedge-tts@2.0.0","provenance":{"predicateType":"https://slsa.dev/provenance/v1"}},"unpackedSize":22631},"type":"module","types":"dist/index.d.ts","module":"dist/index.mjs","gitHead":"1ae4da9c6d95308d8df951f63f4141059b507049","scripts":{"b":"rm -rf dist && bun run build:main && bun run build:types","fmt":"prettier . -w --cache --cache-strategy metadata","typecheck":"tsc -b --incremental --noEmit","build:main":"bun build src/index.ts --outfile dist/index.mjs --format esm --packages external --minify --target browser","build:types":"dts-bundle-generator src/index.ts -o dist/index.d.ts --external-imports","prepublishOnly":"bun run b"},"_npmUser":{"name":"GitHub Actions","email":"npm-oidc-no-reply@github.com","trustedPublisher":{"id":"github","oidcConfigId":"oidc:2f1b922d-7788-4d3d-b41c-b07ee5ff0204"}},"repository":{"url":"git+https://github.com/The-Best-Codes/edge-tts.git","type":"git"},"_npmVersion":"11.6.2","description":"Free in-browser Text-to-Speech using Microsoft Edge TTS","directories":{},"_nodeVersion":"24.12.0","dependencies":{"ws":"^8.18.3","uuid":"^13.0.0","axios":"^1.13.2","https-proxy-agent":"^7.0.6"},"_hasShrinkwrap":false,"devDependencies":{"prettier":"^3.7.4","@types/ws":"^8.18.1","@types/bun":"^1.3.5","@types/node":"^25.0.3","@types/uuid":"^11.0.0","dts-bundle-generator":"^9.5.1"},"peerDependencies":{"typescript":"^5.9.3"},"_npmOperationalInternal":{"tmp":"tmp/edge-tts_2.0.0_1766777207671_0.22909522729723353","host":"s3://npm-registry-packages-npm-production"}},"3.0.0":{"name":"@bestcodes/edge-tts","version":"3.0.0","keywords":["tts","text to speech","speech","edge","edgetts"],"author":{"url":"https://bestcodes.dev","name":"The-Best-Codes"},"license":"MIT","_id":"@bestcodes/edge-tts@3.0.0","maintainers":[{"name":"bestcodes","email":"bestcodes.official@gmail.com"}],"homepage":"https://github.com/The-Best-Codes/edge-tts","bugs":{"url":"https://github.com/The-Best-Codes/edge-tts/issues"},"dist":{"shasum":"29d20d6e4fcee4df47fa2eb3e93f2d763e55d1b9","tarball":"https://registry.npmjs.org/@bestcodes/edge-tts/-/edge-tts-3.0.0.tgz","fileCount":4,"integrity":"sha512-A2VNHVWqMmTggX12XZ/D5kH4cHsgx6EaJg5MUVay2LJx4xMo1ElmDyXz3+HaygWWZtvLUiiCN+VPlGKiO8FhtA==","signatures":[{"sig":"MEUCIQCNmkrO1pyPXUmMp8bePnTghUgZIEYOcBot7DbYtV0QIgIgBQHp/6MjmDPu2pRwS+maXxOr+kuela1f7vNlHrqG3pI=","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"attestations":{"url":"https://registry.npmjs.org/-/npm/v1/attestations/@bestcodes%2fedge-tts@3.0.0","provenance":{"predicateType":"https://slsa.dev/provenance/v1"}},"unpackedSize":26348},"type":"module","types":"dist/index.d.ts","module":"dist/index.mjs","gitHead":"91d9229f4321588be815e91b14edaa97c606f597","scripts":{"b":"rm -rf dist && bun run build:main && bun run build:types","fmt":"prettier . -w --cache --cache-strategy metadata","typecheck":"tsc -b --incremental --noEmit","build:main":"bun build src/index.ts --outfile dist/index.mjs --format esm --packages external --minify --target browser","build:types":"dts-bundle-generator src/index.ts -o dist/index.d.ts --external-imports","prepublishOnly":"bun run b"},"_npmUser":{"name":"GitHub Actions","email":"npm-oidc-no-reply@github.com","trustedPublisher":{"id":"github","oidcConfigId":"oidc:2f1b922d-7788-4d3d-b41c-b07ee5ff0204"}},"repository":{"url":"git+https://github.com/The-Best-Codes/edge-tts.git","type":"git"},"_npmVersion":"11.6.2","description":"Free in-browser Text-to-Speech using Microsoft Edge TTS","directories":{},"_nodeVersion":"24.12.0","dependencies":{"ws":"^8.18.3","uuid":"^13.0.0","axios":"^1.13.2","https-proxy-agent":"^7.0.6"},"_hasShrinkwrap":false,"devDependencies":{"prettier":"^3.7.4","@types/ws":"^8.18.1","@types/bun":"^1.3.5","@types/node":"^25.0.3","@types/uuid":"^11.0.0","dts-bundle-generator":"^9.5.1"},"peerDependencies":{"typescript":"^5.9.3"},"_npmOperationalInternal":{"tmp":"tmp/edge-tts_3.0.0_1766784228274_0.10598889677146306","host":"s3://npm-registry-packages-npm-production"}},"3.0.1":{"name":"@bestcodes/edge-tts","description":"Free Text-to-Speech using Microsoft Edge TTS","repository":{"type":"git","url":"git+https://github.com/The-Best-Codes/edge-tts.git"},"keywords":["tts","text to speech","speech","edge","edgetts"],"license":"MIT","bugs":{"url":"https://github.com/The-Best-Codes/edge-tts/issues"},"homepage":"https://github.com/The-Best-Codes/edge-tts","version":"3.0.1","author":{"name":"The-Best-Codes","url":"https://bestcodes.dev"},"module":"dist/index.mjs","types":"dist/index.d.ts","type":"module","scripts":{"prepublishOnly":"bun run b","b":"rm -rf dist && bun run build:main && bun run build:types","build:main":"bun build src/index.ts --outfile dist/index.mjs --format esm --packages external --minify --target node","build:types":"dts-bundle-generator src/index.ts -o dist/index.d.ts --external-imports","typecheck":"tsc -b --incremental --noEmit","fmt":"prettier . -w --cache --cache-strategy metadata"},"devDependencies":{"@types/bun":"^1.3.5","@types/node":"^25.0.3","@types/uuid":"^11.0.0","@types/ws":"^8.18.1","dts-bundle-generator":"^9.5.1","prettier":"^3.7.4"},"peerDependencies":{"typescript":"^5.9.3"},"dependencies":{"axios":"^1.13.2","https-proxy-agent":"^7.0.6","uuid":"^13.0.0","ws":"^8.18.3"},"gitHead":"b36a2524bebcc5b8370a0df571560fbd4c12b50f","_id":"@bestcodes/edge-tts@3.0.1","_nodeVersion":"24.12.0","_npmVersion":"11.6.2","dist":{"integrity":"sha512-k8tcTRIcw6YWVZonOWrKjkItQqevnzuJ5AiRpYms1pFAGUdcPsenmQ3+WVw118WqPweJAkGvkWfJdUp9JDHiiQ==","shasum":"8ebbf2a43463164d9dac1fc36fcdd36807dc965e","tarball":"https://registry.npmjs.org/@bestcodes/edge-tts/-/edge-tts-3.0.1.tgz","fileCount":4,"unpackedSize":26334,"attestations":{"url":"https://registry.npmjs.org/-/npm/v1/attestations/@bestcodes%2fedge-tts@3.0.1","provenance":{"predicateType":"https://slsa.dev/provenance/v1"}},"signatures":[{"keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U","sig":"MEUCIBh/LGTbCn2xMFiGQaAtZWXdfwoCyopXvtntmbOzJbhUAiEAsbBU9/LqUW6j+QRVMYl27xkb3Ad1hpxk2VFZpb6ziEM="}]},"_npmUser":{"name":"GitHub Actions","email":"npm-oidc-no-reply@github.com","trustedPublisher":{"id":"github","oidcConfigId":"oidc:2f1b922d-7788-4d3d-b41c-b07ee5ff0204"}},"directories":{},"maintainers":[{"name":"bestcodes","email":"bestcodes.official@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages-npm-production","tmp":"tmp/edge-tts_3.0.1_1766889308652_0.24061425527501146"},"_hasShrinkwrap":false}},"time":{"created":"2024-10-25T22:33:31.466Z","modified":"2025-12-28T02:35:09.162Z","1.0.1":"2024-10-25T22:33:31.817Z","1.0.2":"2024-10-25T22:34:50.261Z","1.0.3":"2024-10-25T22:49:07.711Z","2.0.0":"2025-12-26T19:26:47.821Z","3.0.0":"2025-12-26T21:23:48.426Z","3.0.1":"2025-12-28T02:35:08.798Z"},"bugs":{"url":"https://github.com/The-Best-Codes/edge-tts/issues"},"author":{"name":"The-Best-Codes","url":"https://bestcodes.dev"},"license":"MIT","homepage":"https://github.com/The-Best-Codes/edge-tts","keywords":["tts","text to speech","speech","edge","edgetts"],"repository":{"type":"git","url":"git+https://github.com/The-Best-Codes/edge-tts.git"},"description":"Free Text-to-Speech using Microsoft Edge TTS","maintainers":[{"name":"bestcodes","email":"bestcodes.official@gmail.com"}],"readme":"# @bestcodes/edge-tts\n\nA TypeScript port of [edge-tts](https://github.com/rany2/edge-tts/). Small, fast, and easy text-to-speech using Microsoft Edge's online service.\n\n- Tiny bundle size (< 50kb)\n- No API keys required\n- Stream audio or save to file\n- Generate SRT subtitles\n- Access to all available Edge voices\n\n## Installation\n\n```bash\nnpm install @bestcodes/edge-tts\n# or\nbun add @bestcodes/edge-tts\n```\n\n## Quick Start\n\n### Get audio buffer\n\n```ts\nimport { generateSpeech } from \"@bestcodes/edge-tts\";\n\nconst audio = await generateSpeech({\n  text: \"Hello, world!\",\n  voice: \"en-US-EmmaMultilingualNeural\",\n});\n\n// Do something with the audio buffer\n```\n\n### Save to file\n\n```ts\nimport { generateSpeechToFile } from \"@bestcodes/edge-tts\";\n\nawait generateSpeechToFile({\n  text: \"Hello, world!\",\n  outputPath: \"./output.mp3\",\n});\n```\n\n### With subtitles\n\n```ts\nimport { generateSpeechWithSubtitlesToFile } from \"@bestcodes/edge-tts\";\n\nconst { audio, subtitles } = await generateSpeechWithSubtitlesToFile({\n  text: \"This text will have subtitles.\",\n  subtitlePath: \"./subtitles.srt\",\n});\n```\n\n## Real-time Streaming\n\n### Stream audio chunks\n\n```ts\nimport { streamSpeech } from \"@bestcodes/edge-tts\";\n\nfor await (const chunk of streamSpeech({\n  text: \"Hello, world!\",\n  voice: \"en-US-EmmaMultilingualNeural\",\n})) {\n  if (chunk.type === \"audio\" && chunk.data) {\n    // Process audio chunk in real-time\n    console.log(`Received ${chunk.data.length} bytes`);\n  }\n}\n```\n\n### Stream directly to file with progress\n\n```ts\nimport { streamSpeechToFile } from \"@bestcodes/edge-tts\";\n\nfor await (const progress of streamSpeechToFile({\n  text: \"Hello, world!\",\n  outputPath: \"./output.mp3\",\n})) {\n  console.log(\n    `Written: ${progress.bytesWritten} bytes (chunk: ${progress.chunkSize})`,\n  );\n}\n```\n\n### Stream with subtitles (real-time updates)\n\n```ts\nimport { streamSpeechWithSubtitlesToFile } from \"@bestcodes/edge-tts\";\n\nfor await (const chunk of streamSpeechWithSubtitlesToFile({\n  text: \"This text will have subtitles.\",\n  subtitlePath: \"./subtitles.srt\",\n})) {\n  if (chunk.type === \"audio\" && chunk.data) {\n    // Process audio chunk\n  } else if (chunk.subtitles) {\n    // Subtitles file updated in real-time\n    console.log(\"Subtitles updated:\", chunk.subtitles);\n  }\n}\n```\n\n## Options\n\n```ts\n{\n  text: string;                    // Required: text to convert\n  voice?: string;                  // Default: \"en-US-EmmaMultilingualNeural\"\n  rate?: string;                   // e.g. \"+10%\" or \"-20%\" (default: \"+0%\")\n  volume?: string;                 // e.g. \"+50%\" or \"-10%\" (default: \"+0%\")\n  pitch?: string;                  // e.g. \"+10Hz\" or \"-5Hz\" (default: \"+0Hz\")\n  boundary?: \"WordBoundary\" | \"SentenceBoundary\";\n  proxy?: string;                  // Optional proxy URL\n  connectTimeoutSeconds?: number;  // Default: 10\n  receiveTimeoutSeconds?: number;  // Default: 60\n  outputPath?: string;             // For generateSpeechToFile/streamSpeechToFile\n  subtitlePath?: string;           // For generateSpeechWithSubtitlesToFile/streamSpeechWithSubtitlesToFile\n}\n```\n\n## List voices\n\n```ts\nimport { getVoices, findVoices } from \"@bestcodes/edge-tts\";\n\n// Get all voices\nconst allVoices = await getVoices();\n\n// Find specific voices\nconst femaleVoices = await findVoices({ Gender: \"Female\" });\nconst englishVoices = await findVoices({ Locale: \"en-US\" });\n```\n\n## Low-level API\n\n```ts\nimport { Experimental_Raw } from \"@bestcodes/edge-tts\";\n\nconst communicate = new Experimental_Raw.Communicate(\n  \"Hello!\",\n  \"en-US-EmmaMultilingualNeural\",\n);\n\nfor await (const chunk of communicate.stream()) {\n  if (chunk.type === \"audio\") {\n    // Process audio data (chunk.data is a Buffer)\n  } else if (chunk.type === \"WordBoundary\") {\n    // Word boundary metadata\n  }\n}\n```\n\n## License\n\nMIT\n","readmeFilename":"README.md"}