{"_id":"@duyquangnvx/edge-tts-universal","_rev":"6-e3e2fe428ec2a8bf89dd67052b85bbbf","name":"@duyquangnvx/edge-tts-universal","dist-tags":{"latest":"1.4.5"},"versions":{"1.4.0":{"name":"@duyquangnvx/edge-tts-universal","version":"1.4.0","keywords":["text-to-speech","tts","edge-tts","speech-synthesis","microsoft-edge","universal","isomorphic","browser","nodejs","cross-platform","speech","voice","audio","ssml","subtitles"],"author":{"url":"https://travis.engineer","name":"Travis","email":"contact@travis.engineer"},"license":"AGPL-3.0","_id":"@duyquangnvx/edge-tts-universal@1.4.0","maintainers":[{"name":"duyquangnvx","email":"duyquangnvx@gmail.com"}],"homepage":"https://github.com/duyquangnvx/edge-tts-universal","bugs":{"url":"https://github.com/duyquangnvx/edge-tts-universal/issues"},"dist":{"shasum":"ed200520df96598bf97567cf22b45f7433d0c488","tarball":"https://registry.npmjs.org/@duyquangnvx/edge-tts-universal/-/edge-tts-universal-1.4.0.tgz","fileCount":35,"integrity":"sha512-JVeZ82QqXw4U6jcEidqX9oiHXWZ+dxksXmddcR+NZ4/HaHQhyVHBFk9goUm0oV2gWpTS7VYULgtSkjWne5iWJA==","signatures":[{"sig":"MEYCIQD9/pL74FRqRs0jCTWPFf6JuxiqXY9cP+tZbpdoap3oTgIhAP1N1Ej+Y0eDaK0l/sgSRYU05keWQpSn7O2V8uItLdHP","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"unpackedSize":1259915},"main":"./dist/index.cjs","type":"module","types":"./dist/index.d.ts","unpkg":"./dist/browser.js","module":"./dist/index.js","browser":{"./dist/index.js":"./dist/browser.js","./dist/index.cjs":"./dist/browser.cjs"},"engines":{"npm":">=9","node":"^18.17 || ^20.9 || >=22"},"exports":{".":{"bun":{"types":"./dist/index.d.ts","import":"./dist/index.js","require":"./dist/index.cjs"},"deno":{"types":"./dist/index.d.ts","import":"./dist/index.js"},"import":{"types":"./dist/index.d.ts","default":"./dist/index.js"},"require":{"types":"./dist/index.d.cts","default":"./dist/index.cjs"}},"./browser":{"bun":{"types":"./dist/browser.d.ts","import":"./dist/browser.js","require":"./dist/browser.cjs"},"deno":{"types":"./dist/browser.d.ts","import":"./dist/browser.js"},"import":{"types":"./dist/browser.d.ts","default":"./dist/browser.js"},"require":{"types":"./dist/browser.d.cts","default":"./dist/browser.cjs"}},"./webworker":{"bun":{"types":"./dist/webworker.d.ts","import":"./dist/webworker.js","require":"./dist/webworker.cjs"},"deno":{"types":"./dist/webworker.d.ts","import":"./dist/webworker.js"},"import":{"types":"./dist/webworker.d.ts","default":"./dist/webworker.js"},"require":{"types":"./dist/webworker.d.cts","default":"./dist/webworker.cjs"}},"./isomorphic":{"bun":{"types":"./dist/isomorphic.d.ts","import":"./dist/isomorphic.js","require":"./dist/isomorphic.cjs"},"deno":{"types":"./dist/isomorphic.d.ts","import":"./dist/isomorphic.js"},"import":{"types":"./dist/isomorphic.d.ts","default":"./dist/isomorphic.js"},"require":{"types":"./dist/isomorphic.d.cts","default":"./dist/isomorphic.cjs"}},"./runtime-detection":{"bun":{"types":"./dist/runtime-detection.d.ts","import":"./dist/runtime-detection.js","require":"./dist/runtime-detection.cjs"},"deno":{"types":"./dist/runtime-detection.d.ts","import":"./dist/runtime-detection.js"},"import":{"types":"./dist/runtime-detection.d.ts","default":"./dist/runtime-detection.js"},"require":{"types":"./dist/runtime-detection.d.cts","default":"./dist/runtime-detection.cjs"}}},"gitHead":"abba97fb713e4e8679577ea2c1f1e4fcc706f560","scripts":{"dev":"tsup --watch","docs":"typedoc","lint":"eslint src examples --ext .ts","size":"size-limit","test":"npm run build && node --test tests/*.test.js","build":"tsup","clean":"rm -rf dist","analyze":"npx @next/bundle-analyzer","lint:fix":"eslint src examples --ext .ts --fix","docs:serve":"typedoc --watch","test:watch":"npm run build && node --test --watch tests/*.test.js","type-check":"tsc --noEmit","publish:all":"npm run publish:npm && npm run publish:jsr","publish:jsr":"deno publish","publish:npm":"npm publish","example:simple":"tsx examples/simple-api.ts","example:voices":"tsx examples/listVoices.ts","prepublishOnly":"npm run build","example:streaming":"tsx examples/streaming.ts","example:universal":"tsx examples/universal-detection.ts","example:isomorphic":"tsx examples/isomorphic-example.ts","example:universal-api":"tsx examples/universal-api.ts"},"_npmUser":{"name":"duyquangnvx","email":"duyquangnvx@gmail.com"},"jsdelivr":"./dist/browser.js","prettier":{"semi":true,"useTabs":false,"tabWidth":2,"printWidth":80,"singleQuote":true,"trailingComma":"es5"},"repository":{"url":"git+https://github.com/duyquangnvx/edge-tts-universal.git","type":"git"},"_npmVersion":"10.9.2","description":"Universal text-to-speech library using Microsoft Edge's online TTS service. Works in Node.js and browsers WITHOUT needing Microsoft Edge, Windows, or an API key","directories":{"example":"examples"},"_nodeVersion":"22.16.0","dependencies":{"ws":"^8.18.3","uuid":"^11.1.0","axios":"^1.12.1","xml-escape":"^1.1.0","cross-fetch":"^4.1.0","isomorphic-ws":"^5.0.0","https-proxy-agent":"^7.0.6"},"_hasShrinkwrap":false,"devDependencies":{"tsx":"^4.20.5","tsup":"^8.5.0","eslint":"^8.57.1","typedoc":"^0.28.5","prettier":"^3.6.2","@types/ws":"^8.18.1","size-limit":"^11.2.0","typescript":"^5.9.2","@types/node":"^22.18.3","@types/uuid":"^10.0.0","@types/xml-escape":"^1.1.3","@typescript-eslint/parser":"^7.18.0","@size-limit/preset-small-lib":"^11.2.0","@typescript-eslint/eslint-plugin":"^7.18.0"},"_npmOperationalInternal":{"tmp":"tmp/edge-tts-universal_1.4.0_1763875950469_0.3720762048976023","host":"s3://npm-registry-packages-npm-production"}},"1.4.1":{"name":"@duyquangnvx/edge-tts-universal","version":"1.4.1","keywords":["text-to-speech","tts","edge-tts","speech-synthesis","microsoft-edge","universal","isomorphic","browser","nodejs","cross-platform","speech","voice","audio","ssml","subtitles"],"author":{"url":"https://travis.engineer","name":"Travis","email":"contact@travis.engineer"},"license":"AGPL-3.0","_id":"@duyquangnvx/edge-tts-universal@1.4.1","maintainers":[{"name":"duyquangnvx","email":"duyquangnvx@gmail.com"}],"homepage":"https://github.com/duyquangnvx/edge-tts-universal","bugs":{"url":"https://github.com/duyquangnvx/edge-tts-universal/issues"},"dist":{"shasum":"5e621561c025554ae78be685563156a148b0310d","tarball":"https://registry.npmjs.org/@duyquangnvx/edge-tts-universal/-/edge-tts-universal-1.4.1.tgz","fileCount":35,"integrity":"sha512-iYYAAn5eZ9ee1mR0sRkbzQvfr2i7FNdsCWiNvRBY7SC4/1ldvpsdIjeqDiCsbls70+s9LNugQVc5MYx92TUUzw==","signatures":[{"sig":"MEQCIBpVlBUxqfGw3qA/ldGoYt/JKOU5rEdSMGPDJqCfXq56AiBcYK6CKtxpwPsxs60j+dzMQZsscKcnV2nP7Gd8MhxBNQ==","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"unpackedSize":1262557},"main":"./dist/index.cjs","type":"module","types":"./dist/index.d.ts","unpkg":"./dist/browser.js","module":"./dist/index.js","browser":{"./dist/index.js":"./dist/browser.js","./dist/index.cjs":"./dist/browser.cjs"},"engines":{"npm":">=9","node":"^18.17 || ^20.9 || >=22"},"exports":{".":{"bun":{"types":"./dist/index.d.ts","import":"./dist/index.js","require":"./dist/index.cjs"},"deno":{"types":"./dist/index.d.ts","import":"./dist/index.js"},"import":{"types":"./dist/index.d.ts","default":"./dist/index.js"},"require":{"types":"./dist/index.d.cts","default":"./dist/index.cjs"}},"./browser":{"bun":{"types":"./dist/browser.d.ts","import":"./dist/browser.js","require":"./dist/browser.cjs"},"deno":{"types":"./dist/browser.d.ts","import":"./dist/browser.js"},"import":{"types":"./dist/browser.d.ts","default":"./dist/browser.js"},"require":{"types":"./dist/browser.d.cts","default":"./dist/browser.cjs"}},"./webworker":{"bun":{"types":"./dist/webworker.d.ts","import":"./dist/webworker.js","require":"./dist/webworker.cjs"},"deno":{"types":"./dist/webworker.d.ts","import":"./dist/webworker.js"},"import":{"types":"./dist/webworker.d.ts","default":"./dist/webworker.js"},"require":{"types":"./dist/webworker.d.cts","default":"./dist/webworker.cjs"}},"./isomorphic":{"bun":{"types":"./dist/isomorphic.d.ts","import":"./dist/isomorphic.js","require":"./dist/isomorphic.cjs"},"deno":{"types":"./dist/isomorphic.d.ts","import":"./dist/isomorphic.js"},"import":{"types":"./dist/isomorphic.d.ts","default":"./dist/isomorphic.js"},"require":{"types":"./dist/isomorphic.d.cts","default":"./dist/isomorphic.cjs"}},"./runtime-detection":{"bun":{"types":"./dist/runtime-detection.d.ts","import":"./dist/runtime-detection.js","require":"./dist/runtime-detection.cjs"},"deno":{"types":"./dist/runtime-detection.d.ts","import":"./dist/runtime-detection.js"},"import":{"types":"./dist/runtime-detection.d.ts","default":"./dist/runtime-detection.js"},"require":{"types":"./dist/runtime-detection.d.cts","default":"./dist/runtime-detection.cjs"}}},"gitHead":"abba97fb713e4e8679577ea2c1f1e4fcc706f560","scripts":{"dev":"tsup --watch","docs":"typedoc","lint":"eslint src examples --ext .ts","size":"size-limit","test":"npm run build && node --test tests/*.test.js","build":"tsup","clean":"rm -rf dist","analyze":"npx @next/bundle-analyzer","lint:fix":"eslint src examples --ext .ts --fix","docs:serve":"typedoc --watch","test:watch":"npm run build && node --test --watch tests/*.test.js","type-check":"tsc --noEmit","publish:all":"npm run publish:npm && npm run publish:jsr","publish:jsr":"deno publish","publish:npm":"npm publish","example:simple":"tsx examples/simple-api.ts","example:voices":"tsx examples/listVoices.ts","prepublishOnly":"npm run build","example:streaming":"tsx examples/streaming.ts","example:universal":"tsx examples/universal-detection.ts","example:isomorphic":"tsx examples/isomorphic-example.ts","example:universal-api":"tsx examples/universal-api.ts"},"_npmUser":{"name":"duyquangnvx","email":"duyquangnvx@gmail.com"},"jsdelivr":"./dist/browser.js","prettier":{"semi":true,"useTabs":false,"tabWidth":2,"printWidth":80,"singleQuote":true,"trailingComma":"es5"},"repository":{"url":"git+https://github.com/duyquangnvx/edge-tts-universal.git","type":"git"},"_npmVersion":"10.9.2","description":"Universal text-to-speech library using Microsoft Edge's online TTS service. Works in Node.js and browsers WITHOUT needing Microsoft Edge, Windows, or an API key","directories":{"example":"examples"},"_nodeVersion":"22.16.0","dependencies":{"ws":"^8.18.3","uuid":"^11.1.0","axios":"^1.12.1","xml-escape":"^1.1.0","cross-fetch":"^4.1.0","isomorphic-ws":"^5.0.0","https-proxy-agent":"^7.0.6"},"_hasShrinkwrap":false,"devDependencies":{"tsx":"^4.20.5","tsup":"^8.5.0","eslint":"^8.57.1","typedoc":"^0.28.5","prettier":"^3.6.2","@types/ws":"^8.18.1","size-limit":"^11.2.0","typescript":"^5.9.2","@types/node":"^22.18.3","@types/uuid":"^10.0.0","@types/xml-escape":"^1.1.3","@typescript-eslint/parser":"^7.18.0","@size-limit/preset-small-lib":"^11.2.0","@typescript-eslint/eslint-plugin":"^7.18.0"},"_npmOperationalInternal":{"tmp":"tmp/edge-tts-universal_1.4.1_1763876208096_0.24893482111954635","host":"s3://npm-registry-packages-npm-production"}},"1.4.2":{"name":"@duyquangnvx/edge-tts-universal","version":"1.4.2","keywords":["text-to-speech","tts","edge-tts","speech-synthesis","microsoft-edge","universal","isomorphic","browser","nodejs","cross-platform","speech","voice","audio","ssml","subtitles"],"author":{"url":"https://travis.engineer","name":"Travis","email":"contact@travis.engineer"},"license":"AGPL-3.0","_id":"@duyquangnvx/edge-tts-universal@1.4.2","maintainers":[{"name":"duyquangnvx","email":"duyquangnvx@gmail.com"}],"homepage":"https://github.com/duyquangnvx/edge-tts-universal","bugs":{"url":"https://github.com/duyquangnvx/edge-tts-universal/issues"},"dist":{"shasum":"cc1fb3244a38792c5f1538c6dc913c7ecb40b6d0","tarball":"https://registry.npmjs.org/@duyquangnvx/edge-tts-universal/-/edge-tts-universal-1.4.2.tgz","fileCount":35,"integrity":"sha512-1pOQx+4tb9v1lrIwNUm08Udl1J0gODtWNcaWF1qlKEDlEQNx5hgv7SrY+mUDNSDnX8gcSf6AG+CVXEQGdAgwCg==","signatures":[{"sig":"MEUCIQD0yBMgjJUvysiJ96A/afispG70apfsynEZ4DDr71qlcQIgZVjEemkEC+YR7+ZRDMM3aFsIUbC/zZFGQY21p1grrr0=","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"unpackedSize":1271315},"main":"./dist/index.cjs","type":"module","types":"./dist/index.d.ts","unpkg":"./dist/browser.js","module":"./dist/index.js","browser":{"./dist/index.js":"./dist/browser.js","./dist/index.cjs":"./dist/browser.cjs"},"engines":{"npm":">=9","node":"^18.17 || ^20.9 || >=22"},"exports":{".":{"bun":{"types":"./dist/index.d.ts","import":"./dist/index.js","require":"./dist/index.cjs"},"deno":{"types":"./dist/index.d.ts","import":"./dist/index.js"},"import":{"types":"./dist/index.d.ts","default":"./dist/index.js"},"require":{"types":"./dist/index.d.cts","default":"./dist/index.cjs"}},"./browser":{"bun":{"types":"./dist/browser.d.ts","import":"./dist/browser.js","require":"./dist/browser.cjs"},"deno":{"types":"./dist/browser.d.ts","import":"./dist/browser.js"},"import":{"types":"./dist/browser.d.ts","default":"./dist/browser.js"},"require":{"types":"./dist/browser.d.cts","default":"./dist/browser.cjs"}},"./webworker":{"bun":{"types":"./dist/webworker.d.ts","import":"./dist/webworker.js","require":"./dist/webworker.cjs"},"deno":{"types":"./dist/webworker.d.ts","import":"./dist/webworker.js"},"import":{"types":"./dist/webworker.d.ts","default":"./dist/webworker.js"},"require":{"types":"./dist/webworker.d.cts","default":"./dist/webworker.cjs"}},"./isomorphic":{"bun":{"types":"./dist/isomorphic.d.ts","import":"./dist/isomorphic.js","require":"./dist/isomorphic.cjs"},"deno":{"types":"./dist/isomorphic.d.ts","import":"./dist/isomorphic.js"},"import":{"types":"./dist/isomorphic.d.ts","default":"./dist/isomorphic.js"},"require":{"types":"./dist/isomorphic.d.cts","default":"./dist/isomorphic.cjs"}},"./runtime-detection":{"bun":{"types":"./dist/runtime-detection.d.ts","import":"./dist/runtime-detection.js","require":"./dist/runtime-detection.cjs"},"deno":{"types":"./dist/runtime-detection.d.ts","import":"./dist/runtime-detection.js"},"import":{"types":"./dist/runtime-detection.d.ts","default":"./dist/runtime-detection.js"},"require":{"types":"./dist/runtime-detection.d.cts","default":"./dist/runtime-detection.cjs"}}},"gitHead":"abba97fb713e4e8679577ea2c1f1e4fcc706f560","scripts":{"dev":"tsup --watch","docs":"typedoc","lint":"eslint src examples --ext .ts","size":"size-limit","test":"npm run build && node --test tests/*.test.js","build":"tsup","clean":"rm -rf dist","analyze":"npx @next/bundle-analyzer","lint:fix":"eslint src examples --ext .ts --fix","docs:serve":"typedoc --watch","test:watch":"npm run build && node --test --watch tests/*.test.js","type-check":"tsc --noEmit","publish:all":"npm run publish:npm && npm run publish:jsr","publish:jsr":"deno publish","publish:npm":"npm publish","example:simple":"tsx examples/simple-api.ts","example:voices":"tsx examples/listVoices.ts","prepublishOnly":"npm run build","example:streaming":"tsx examples/streaming.ts","example:universal":"tsx examples/universal-detection.ts","example:isomorphic":"tsx examples/isomorphic-example.ts","example:universal-api":"tsx examples/universal-api.ts"},"_npmUser":{"name":"duyquangnvx","email":"duyquangnvx@gmail.com"},"jsdelivr":"./dist/browser.js","prettier":{"semi":true,"useTabs":false,"tabWidth":2,"printWidth":80,"singleQuote":true,"trailingComma":"es5"},"repository":{"url":"git+https://github.com/duyquangnvx/edge-tts-universal.git","type":"git"},"_npmVersion":"10.9.2","description":"Universal text-to-speech library using Microsoft Edge's online TTS service. Works in Node.js and browsers WITHOUT needing Microsoft Edge, Windows, or an API key","directories":{"example":"examples"},"_nodeVersion":"22.16.0","dependencies":{"ws":"^8.18.3","uuid":"^11.1.0","axios":"^1.12.1","xml-escape":"^1.1.0","cross-fetch":"^4.1.0","isomorphic-ws":"^5.0.0","https-proxy-agent":"^7.0.6"},"_hasShrinkwrap":false,"devDependencies":{"tsx":"^4.20.5","tsup":"^8.5.0","eslint":"^8.57.1","typedoc":"^0.28.5","prettier":"^3.6.2","@types/ws":"^8.18.1","size-limit":"^11.2.0","typescript":"^5.9.2","@types/node":"^22.18.3","@types/uuid":"^10.0.0","@types/xml-escape":"^1.1.3","@typescript-eslint/parser":"^7.18.0","@size-limit/preset-small-lib":"^11.2.0","@typescript-eslint/eslint-plugin":"^7.18.0"},"_npmOperationalInternal":{"tmp":"tmp/edge-tts-universal_1.4.2_1763876572660_0.9904844251551987","host":"s3://npm-registry-packages-npm-production"}},"1.4.3":{"name":"@duyquangnvx/edge-tts-universal","version":"1.4.3","keywords":["text-to-speech","tts","edge-tts","speech-synthesis","microsoft-edge","universal","isomorphic","browser","nodejs","cross-platform","speech","voice","audio","ssml","subtitles"],"author":{"url":"https://travis.engineer","name":"Travis","email":"contact@travis.engineer"},"license":"AGPL-3.0","_id":"@duyquangnvx/edge-tts-universal@1.4.3","maintainers":[{"name":"duyquangnvx","email":"duyquangnvx@gmail.com"}],"homepage":"https://github.com/duyquangnvx/edge-tts-universal","bugs":{"url":"https://github.com/duyquangnvx/edge-tts-universal/issues"},"dist":{"shasum":"679f62dc31198d4a7f9458d755a37113c42a62ba","tarball":"https://registry.npmjs.org/@duyquangnvx/edge-tts-universal/-/edge-tts-universal-1.4.3.tgz","fileCount":35,"integrity":"sha512-zqTkJqHYgQ/sX0Kz1mBEEZs3tiWmsGXVmQR0x9pRONbOx+/IIUcDtEl8+xlkD23VEw43h7gofS8Z3rZJAxMPRQ==","signatures":[{"sig":"MEUCIQDov4e4Ofhi57mk5lnkkOTcjs6+oWVHG7BXNvNasGc3rQIgYK01ZQHACB3BBOf6lPU7fvmAGlGcriy8qGs6G+JyAig=","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"unpackedSize":1272787},"main":"./dist/index.cjs","type":"module","types":"./dist/index.d.ts","unpkg":"./dist/browser.js","module":"./dist/index.js","browser":{"./dist/index.js":"./dist/browser.js","./dist/index.cjs":"./dist/browser.cjs"},"engines":{"npm":">=9","node":"^18.17 || ^20.9 || >=22"},"exports":{".":{"bun":{"types":"./dist/index.d.ts","import":"./dist/index.js","require":"./dist/index.cjs"},"deno":{"types":"./dist/index.d.ts","import":"./dist/index.js"},"import":{"types":"./dist/index.d.ts","default":"./dist/index.js"},"require":{"types":"./dist/index.d.cts","default":"./dist/index.cjs"}},"./browser":{"bun":{"types":"./dist/browser.d.ts","import":"./dist/browser.js","require":"./dist/browser.cjs"},"deno":{"types":"./dist/browser.d.ts","import":"./dist/browser.js"},"import":{"types":"./dist/browser.d.ts","default":"./dist/browser.js"},"require":{"types":"./dist/browser.d.cts","default":"./dist/browser.cjs"}},"./webworker":{"bun":{"types":"./dist/webworker.d.ts","import":"./dist/webworker.js","require":"./dist/webworker.cjs"},"deno":{"types":"./dist/webworker.d.ts","import":"./dist/webworker.js"},"import":{"types":"./dist/webworker.d.ts","default":"./dist/webworker.js"},"require":{"types":"./dist/webworker.d.cts","default":"./dist/webworker.cjs"}},"./isomorphic":{"bun":{"types":"./dist/isomorphic.d.ts","import":"./dist/isomorphic.js","require":"./dist/isomorphic.cjs"},"deno":{"types":"./dist/isomorphic.d.ts","import":"./dist/isomorphic.js"},"import":{"types":"./dist/isomorphic.d.ts","default":"./dist/isomorphic.js"},"require":{"types":"./dist/isomorphic.d.cts","default":"./dist/isomorphic.cjs"}},"./runtime-detection":{"bun":{"types":"./dist/runtime-detection.d.ts","import":"./dist/runtime-detection.js","require":"./dist/runtime-detection.cjs"},"deno":{"types":"./dist/runtime-detection.d.ts","import":"./dist/runtime-detection.js"},"import":{"types":"./dist/runtime-detection.d.ts","default":"./dist/runtime-detection.js"},"require":{"types":"./dist/runtime-detection.d.cts","default":"./dist/runtime-detection.cjs"}}},"gitHead":"39d65c0751559d3e0165bae42e0ed1396ddd40c8","scripts":{"dev":"tsup --watch","docs":"typedoc","lint":"eslint src examples --ext .ts","size":"size-limit","test":"npm run build && node --test tests/*.test.js","build":"tsup","clean":"rm -rf dist","analyze":"npx @next/bundle-analyzer","lint:fix":"eslint src examples --ext .ts --fix","docs:serve":"typedoc --watch","test:watch":"npm run build && node --test --watch tests/*.test.js","type-check":"tsc --noEmit","publish:all":"npm run publish:npm && npm run publish:jsr","publish:jsr":"deno publish","publish:npm":"npm publish","example:simple":"tsx examples/simple-api.ts","example:voices":"tsx examples/listVoices.ts","prepublishOnly":"npm run build","example:streaming":"tsx examples/streaming.ts","example:universal":"tsx examples/universal-detection.ts","example:isomorphic":"tsx examples/isomorphic-example.ts","example:universal-api":"tsx examples/universal-api.ts"},"_npmUser":{"name":"duyquangnvx","email":"duyquangnvx@gmail.com"},"jsdelivr":"./dist/browser.js","prettier":{"semi":true,"useTabs":false,"tabWidth":2,"printWidth":80,"singleQuote":true,"trailingComma":"es5"},"repository":{"url":"git+https://github.com/duyquangnvx/edge-tts-universal.git","type":"git"},"_npmVersion":"10.9.2","description":"Universal text-to-speech library using Microsoft Edge's online TTS service. Works in Node.js and browsers WITHOUT needing Microsoft Edge, Windows, or an API key","directories":{"example":"examples"},"_nodeVersion":"22.16.0","dependencies":{"ws":"^8.18.3","uuid":"^11.1.0","axios":"^1.12.1","xml-escape":"^1.1.0","cross-fetch":"^4.1.0","isomorphic-ws":"^5.0.0","https-proxy-agent":"^7.0.6"},"_hasShrinkwrap":false,"devDependencies":{"tsx":"^4.20.5","tsup":"^8.5.0","eslint":"^8.57.1","typedoc":"^0.28.5","prettier":"^3.6.2","@types/ws":"^8.18.1","size-limit":"^11.2.0","typescript":"^5.9.2","@types/node":"^22.18.3","@types/uuid":"^10.0.0","@types/xml-escape":"^1.1.3","@typescript-eslint/parser":"^7.18.0","@size-limit/preset-small-lib":"^11.2.0","@typescript-eslint/eslint-plugin":"^7.18.0"},"_npmOperationalInternal":{"tmp":"tmp/edge-tts-universal_1.4.3_1763877009543_0.16199074927147694","host":"s3://npm-registry-packages-npm-production"}},"1.4.4":{"name":"@duyquangnvx/edge-tts-universal","version":"1.4.4","keywords":["text-to-speech","tts","edge-tts","speech-synthesis","microsoft-edge","universal","isomorphic","browser","nodejs","cross-platform","speech","voice","audio","ssml","subtitles"],"author":{"url":"https://travis.engineer","name":"Travis","email":"contact@travis.engineer"},"license":"AGPL-3.0","_id":"@duyquangnvx/edge-tts-universal@1.4.4","maintainers":[{"name":"duyquangnvx","email":"duyquangnvx@gmail.com"}],"homepage":"https://github.com/duyquangnvx/edge-tts-universal","bugs":{"url":"https://github.com/duyquangnvx/edge-tts-universal/issues"},"dist":{"shasum":"70d78fc97a6864e32dece706eb1d6584754d7b6b","tarball":"https://registry.npmjs.org/@duyquangnvx/edge-tts-universal/-/edge-tts-universal-1.4.4.tgz","fileCount":33,"integrity":"sha512-d+nLxWJrvc8crdzICQTFzC/6XCuiI/gNdSYY+OB3ki4uvL+xG5IDpSFi5/y2ZQT4IQ2j0dXKY4gEhBJgjU99CQ==","signatures":[{"sig":"MEUCID38b7/Fp3jNzRv3M5DfOWWaaB8Fix3Y+MjI+B2HAEnGAiEAm+/bmwq9mbPlK/eW883gl9AsD+YDwC+TI7U/zcq6jcg=","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"unpackedSize":1244703},"main":"./dist/index.cjs","type":"module","types":"./dist/index.d.ts","unpkg":"./dist/browser.js","module":"./dist/index.js","browser":{"./dist/index.js":"./dist/browser.js","./dist/index.cjs":"./dist/browser.cjs"},"engines":{"npm":">=9","node":"^18.17 || ^20.9 || >=22"},"exports":{".":{"bun":{"types":"./dist/index.d.ts","import":"./dist/index.js","require":"./dist/index.cjs"},"deno":{"types":"./dist/index.d.ts","import":"./dist/index.js"},"import":{"types":"./dist/index.d.ts","default":"./dist/index.js"},"require":{"types":"./dist/index.d.cts","default":"./dist/index.cjs"}},"./browser":{"bun":{"types":"./dist/browser.d.ts","import":"./dist/browser.js","require":"./dist/browser.cjs"},"deno":{"types":"./dist/browser.d.ts","import":"./dist/browser.js"},"import":{"types":"./dist/browser.d.ts","default":"./dist/browser.js"},"require":{"types":"./dist/browser.d.cts","default":"./dist/browser.cjs"}},"./webworker":{"bun":{"types":"./dist/webworker.d.ts","import":"./dist/webworker.js","require":"./dist/webworker.cjs"},"deno":{"types":"./dist/webworker.d.ts","import":"./dist/webworker.js"},"import":{"types":"./dist/webworker.d.ts","default":"./dist/webworker.js"},"require":{"types":"./dist/webworker.d.cts","default":"./dist/webworker.cjs"}},"./isomorphic":{"bun":{"types":"./dist/isomorphic.d.ts","import":"./dist/isomorphic.js","require":"./dist/isomorphic.cjs"},"deno":{"types":"./dist/isomorphic.d.ts","import":"./dist/isomorphic.js"},"import":{"types":"./dist/isomorphic.d.ts","default":"./dist/isomorphic.js"},"require":{"types":"./dist/isomorphic.d.cts","default":"./dist/isomorphic.cjs"}},"./runtime-detection":{"bun":{"types":"./dist/runtime-detection.d.ts","import":"./dist/runtime-detection.js","require":"./dist/runtime-detection.cjs"},"deno":{"types":"./dist/runtime-detection.d.ts","import":"./dist/runtime-detection.js"},"import":{"types":"./dist/runtime-detection.d.ts","default":"./dist/runtime-detection.js"},"require":{"types":"./dist/runtime-detection.d.cts","default":"./dist/runtime-detection.cjs"}}},"gitHead":"39d65c0751559d3e0165bae42e0ed1396ddd40c8","scripts":{"dev":"tsup --watch","docs":"typedoc","lint":"eslint src examples --ext .ts","size":"size-limit","test":"npm run build && node --test tests/*.test.js","build":"tsup","clean":"rm -rf dist","analyze":"npx @next/bundle-analyzer","lint:fix":"eslint src examples --ext .ts --fix","docs:serve":"typedoc --watch","test:watch":"npm run build && node --test --watch tests/*.test.js","type-check":"tsc --noEmit","publish:all":"npm run publish:npm && npm run publish:jsr","publish:jsr":"deno publish","publish:npm":"npm publish","example:simple":"tsx examples/simple-api.ts","example:voices":"tsx examples/listVoices.ts","prepublishOnly":"npm run build","example:streaming":"tsx examples/streaming.ts","example:universal":"tsx examples/universal-detection.ts","example:isomorphic":"tsx examples/isomorphic-example.ts","example:universal-api":"tsx examples/universal-api.ts"},"_npmUser":{"name":"duyquangnvx","email":"duyquangnvx@gmail.com"},"jsdelivr":"./dist/browser.js","prettier":{"semi":true,"useTabs":false,"tabWidth":2,"printWidth":80,"singleQuote":true,"trailingComma":"es5"},"repository":{"url":"git+https://github.com/duyquangnvx/edge-tts-universal.git","type":"git"},"_npmVersion":"10.9.2","description":"Universal text-to-speech library using Microsoft Edge's online TTS service. Works in Node.js and browsers WITHOUT needing Microsoft Edge, Windows, or an API key","directories":{"example":"examples"},"_nodeVersion":"22.16.0","dependencies":{"ws":"^8.18.3","uuid":"^11.1.0","axios":"^1.12.1","xml-escape":"^1.1.0","cross-fetch":"^4.1.0","isomorphic-ws":"^5.0.0","https-proxy-agent":"^7.0.6"},"_hasShrinkwrap":false,"devDependencies":{"tsx":"^4.20.5","tsup":"^8.5.0","eslint":"^8.57.1","typedoc":"^0.28.5","prettier":"^3.6.2","@types/ws":"^8.18.1","size-limit":"^11.2.0","typescript":"^5.9.2","@types/node":"^22.18.3","@types/uuid":"^10.0.0","@types/xml-escape":"^1.1.3","@typescript-eslint/parser":"^7.18.0","@size-limit/preset-small-lib":"^11.2.0","@typescript-eslint/eslint-plugin":"^7.18.0"},"_npmOperationalInternal":{"tmp":"tmp/edge-tts-universal_1.4.4_1763877716344_0.4342962058911568","host":"s3://npm-registry-packages-npm-production"}},"1.4.5":{"name":"@duyquangnvx/edge-tts-universal","version":"1.4.5","description":"Universal text-to-speech library using Microsoft Edge's online TTS service. Works in Node.js and browsers WITHOUT needing Microsoft Edge, Windows, or an API key","type":"module","main":"./dist/index.cjs","module":"./dist/index.js","types":"./dist/index.d.ts","unpkg":"./dist/browser.js","jsdelivr":"./dist/browser.js","browser":{"./dist/index.js":"./dist/browser.js","./dist/index.cjs":"./dist/browser.cjs"},"engines":{"node":"^18.17 || ^20.9 || >=22","npm":">=9"},"exports":{".":{"bun":{"types":"./dist/index.d.ts","import":"./dist/index.js","require":"./dist/index.cjs"},"deno":{"types":"./dist/index.d.ts","import":"./dist/index.js"},"import":{"types":"./dist/index.d.ts","default":"./dist/index.js"},"require":{"types":"./dist/index.d.cts","default":"./dist/index.cjs"}},"./browser":{"bun":{"types":"./dist/browser.d.ts","import":"./dist/browser.js","require":"./dist/browser.cjs"},"deno":{"types":"./dist/browser.d.ts","import":"./dist/browser.js"},"import":{"types":"./dist/browser.d.ts","default":"./dist/browser.js"},"require":{"types":"./dist/browser.d.cts","default":"./dist/browser.cjs"}},"./isomorphic":{"bun":{"types":"./dist/isomorphic.d.ts","import":"./dist/isomorphic.js","require":"./dist/isomorphic.cjs"},"deno":{"types":"./dist/isomorphic.d.ts","import":"./dist/isomorphic.js"},"import":{"types":"./dist/isomorphic.d.ts","default":"./dist/isomorphic.js"},"require":{"types":"./dist/isomorphic.d.cts","default":"./dist/isomorphic.cjs"}},"./webworker":{"bun":{"types":"./dist/webworker.d.ts","import":"./dist/webworker.js","require":"./dist/webworker.cjs"},"deno":{"types":"./dist/webworker.d.ts","import":"./dist/webworker.js"},"import":{"types":"./dist/webworker.d.ts","default":"./dist/webworker.js"},"require":{"types":"./dist/webworker.d.cts","default":"./dist/webworker.cjs"}},"./runtime-detection":{"bun":{"types":"./dist/runtime-detection.d.ts","import":"./dist/runtime-detection.js","require":"./dist/runtime-detection.cjs"},"deno":{"types":"./dist/runtime-detection.d.ts","import":"./dist/runtime-detection.js"},"import":{"types":"./dist/runtime-detection.d.ts","default":"./dist/runtime-detection.js"},"require":{"types":"./dist/runtime-detection.d.cts","default":"./dist/runtime-detection.cjs"}}},"scripts":{"build":"tsup","dev":"tsup --watch","docs":"typedoc","docs:serve":"typedoc --watch","prepublishOnly":"npm run build","test":"npm run build && node --test tests/*.test.js","test:watch":"npm run build && node --test --watch tests/*.test.js","lint":"eslint src examples --ext .ts","lint:fix":"eslint src examples --ext .ts --fix","type-check":"tsc --noEmit","clean":"rm -rf dist","example:simple":"tsx examples/simple-api.ts","example:streaming":"tsx examples/streaming.ts","example:voices":"tsx examples/listVoices.ts","example:universal":"tsx examples/universal-detection.ts","example:universal-api":"tsx examples/universal-api.ts","example:isomorphic":"tsx examples/isomorphic-example.ts","size":"size-limit","analyze":"npx @next/bundle-analyzer","publish:jsr":"deno publish","publish:npm":"npm publish --access public","publish":"npm run publish:npm","publish:all":"npm run publish:npm && npm run publish:jsr"},"keywords":["text-to-speech","tts","edge-tts","speech-synthesis","microsoft-edge","universal","isomorphic","browser","nodejs","cross-platform","speech","voice","audio","ssml","subtitles"],"author":{"name":"Travis","email":"contact@travis.engineer","url":"https://travis.engineer"},"license":"AGPL-3.0","homepage":"https://github.com/duyquangnvx/edge-tts-universal","bugs":{"url":"https://github.com/duyquangnvx/edge-tts-universal/issues"},"dependencies":{"axios":"^1.12.1","cross-fetch":"^4.1.0","https-proxy-agent":"^7.0.6","isomorphic-ws":"^5.0.0","uuid":"^11.1.0","ws":"^8.18.3","xml-escape":"^1.1.0"},"devDependencies":{"@size-limit/preset-small-lib":"^11.2.0","@types/node":"^22.18.3","@types/uuid":"^10.0.0","@types/ws":"^8.18.1","@types/xml-escape":"^1.1.3","@typescript-eslint/eslint-plugin":"^7.18.0","@typescript-eslint/parser":"^7.18.0","eslint":"^8.57.1","prettier":"^3.6.2","size-limit":"^11.2.0","tsup":"^8.5.0","tsx":"^4.20.5","typedoc":"^0.28.5","typescript":"^5.9.2"},"directories":{"example":"examples"},"repository":{"type":"git","url":"git+https://github.com/duyquangnvx/edge-tts-universal.git"},"prettier":{"semi":true,"trailingComma":"es5","singleQuote":true,"printWidth":80,"tabWidth":2,"useTabs":false},"_id":"@duyquangnvx/edge-tts-universal@1.4.5","gitHead":"6704de48ab79660ab79b7801262ba6456a6bc7da","_nodeVersion":"22.21.1","_npmVersion":"10.9.4","dist":{"integrity":"sha512-WOfRyX7JVLwqe0bfTPd+58PW8QPza/gjVvldULXBJRcqrhRyYvIWYhz8nEdt/NtkuYoRfRD1oY8NwaPlintUMQ==","shasum":"2575e0c039dae872b22765320859ae894ac69375","tarball":"https://registry.npmjs.org/@duyquangnvx/edge-tts-universal/-/edge-tts-universal-1.4.5.tgz","fileCount":35,"unpackedSize":1302870,"signatures":[{"keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U","sig":"MEUCIBM7WYpRBuH3BZGbAZo+wDjd1hGDNZr6Ub1RGf/CRfFqAiEAscBjifhbx6QI6J6uk3gWHxapxB6v9cd6k/74xH9lBy0="}]},"_npmUser":{"name":"duyquangnvx","email":"duyquangnvx@gmail.com"},"maintainers":[{"name":"duyquangnvx","email":"duyquangnvx@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages-npm-production","tmp":"tmp/edge-tts-universal_1.4.5_1766064547432_0.4689604477036948"},"_hasShrinkwrap":false}},"time":{"created":"2025-11-23T05:32:30.362Z","modified":"2025-12-18T13:29:07.814Z","1.4.0":"2025-11-23T05:32:30.734Z","1.4.1":"2025-11-23T05:36:48.304Z","1.4.2":"2025-11-23T05:42:52.907Z","1.4.3":"2025-11-23T05:50:09.797Z","1.4.4":"2025-11-23T06:01:56.615Z","1.4.5":"2025-12-18T13:29:07.629Z"},"bugs":{"url":"https://github.com/duyquangnvx/edge-tts-universal/issues"},"author":{"name":"Travis","email":"contact@travis.engineer","url":"https://travis.engineer"},"license":"AGPL-3.0","homepage":"https://github.com/duyquangnvx/edge-tts-universal","keywords":["text-to-speech","tts","edge-tts","speech-synthesis","microsoft-edge","universal","isomorphic","browser","nodejs","cross-platform","speech","voice","audio","ssml","subtitles"],"repository":{"type":"git","url":"git+https://github.com/duyquangnvx/edge-tts-universal.git"},"description":"Universal text-to-speech library using Microsoft Edge's online TTS service. Works in Node.js and browsers WITHOUT needing Microsoft Edge, Windows, or an API key","maintainers":[{"name":"duyquangnvx","email":"duyquangnvx@gmail.com"}],"readme":"# Edge TTS Universal 🪐\r\n\r\n[![API Documentation](https://img.shields.io/badge/API-Documentation-blue)](./API.md)\r\n[![npm](https://img.shields.io/npm/v/edge-tts-universal)](https://www.npmjs.com/package/edge-tts-universal)\r\n[![JSR](https://jsr.io/badges/@edge-tts/universal)](https://jsr.io/@edge-tts/universal)\r\n[![Downloads](https://img.shields.io/npm/dm/edge-tts-universal)](https://www.npmjs.com/package/edge-tts-universal)\r\n[![Tree Shaking](https://img.shields.io/badge/tree%20shaking-✓-green)](#bundle-optimization)\r\n[![JSR Score](https://jsr.io/badges/@edge-tts/universal/score)](https://jsr.io/@edge-tts/universal)\r\n\r\nThis is a **universal** TypeScript conversion of the Python [`edge-tts`](https://github.com/rany2/edge-tts) library. It allows you to use Microsoft Edge's online text-to-speech service from **Node.js, browsers, and any JavaScript environment**.\r\n\r\n## 🌟 Universal Features\r\n\r\n- **🚀 Multiple Entry Points**: Node.js, browser, and Universal (cross-platform) APIs\r\n- **🌐 True Universal**: Works identically in Node.js, browsers, Deno, Bun, and edge runtimes\r\n- **📦 Tree-Shakable**: Import only what you need for optimal bundle size\r\n- **🔄 Universal & Isomorphic**: Same API works across all environments using Web standards\r\n- **⚡ Zero Dependencies**: Universal builds use only native Web APIs\r\n- **🛡️ Type Safe**: Full TypeScript support with comprehensive type definitions\r\n\r\nThis package provides high fidelity to the original Python implementation, replicating the specific headers and WebSocket communication necessary to interact with Microsoft's service.\r\n\r\n## Installation\r\n\r\n```bash\r\nnpm install edge-tts-universal\r\n# or\r\nyarn add edge-tts-universal\r\n```\r\n\r\n## Universal Usage\r\n\r\nThis package provides multiple entry points for different use cases:\r\n\r\n### 🌍 Universal API (Recommended - Works Everywhere)\r\n\r\n```typescript\r\nimport {\r\n  UniversalEdgeTTS,\r\n  UniversalCommunicate,\r\n  UniversalVoicesManager,\r\n  listVoicesUniversal\r\n} from 'edge-tts-universal';\r\n\r\n// Works identically in Node.js, Deno, Bun, and browsers\r\nconst tts = new UniversalEdgeTTS('Hello, world!', 'en-US-EmmaMultilingualNeural');\r\nconst result = await tts.synthesize();\r\n```\r\n\r\n### 📦 Node.js Optimized (Full Features)\r\n\r\n```typescript\r\nimport {\r\n  EdgeTTS,\r\n  Communicate,\r\n  VoicesManager\r\n} from 'edge-tts-universal';\r\n\r\n// Node.js with proxy support, full headers, etc.\r\nconst tts = new EdgeTTS('Hello, world!');\r\n```\r\n\r\n### 🌐 Browser-Only (Minimal Bundle)\r\n\r\n```typescript\r\nimport { EdgeTTS, Communicate } from 'edge-tts-universal/browser';\r\n```\r\n\r\n### 🔄 Legacy Isomorphic (Still Supported)\r\n\r\n```typescript\r\nimport {\r\n  IsomorphicEdgeTTS,\r\n  IsomorphicCommunicate\r\n} from 'edge-tts-universal';\r\n```\r\n\r\n## Runtime Compatibility\r\n\r\n| Runtime | Universal API | Node.js API | Browser API | Status |\r\n|---------|---------------|-------------|-------------|---------|\r\n| Node.js 16+ | ✅ Full | ✅ Full | ❌ N/A | Perfect |\r\n| Deno | ✅ Full | ❌ N/A | ❌ N/A | Perfect |\r\n| Bun | ✅ Full | ✅ Full | ❌ N/A | Perfect |\r\n| Chrome/Firefox | ✅ Full | ❌ N/A | ✅ Full | Perfect |\r\n| Edge/Safari | ✅ Full | ❌ N/A | ✅ Full | Perfect |\r\n\r\n### Key Improvements\r\n\r\n- **Universal API**: Uses Web standards (WebSocket, Web Crypto, fetch) for maximum compatibility\r\n- **Smart Headers**: Automatically uses optimal WebSocket headers where supported\r\n- **Zero Dependencies**: Universal builds bundle everything for true portability\r\n- **Backward Compatible**: All existing \"Isomorphic\" APIs still work\r\n\r\n## Quick Start\r\n\r\n```typescript\r\nimport { UniversalEdgeTTS } from 'edge-tts-universal';\r\n\r\nconst tts = new UniversalEdgeTTS('Hello, world!', 'en-US-EmmaMultilingualNeural');\r\nconst result = await tts.synthesize();\r\n\r\n// Works in Node.js, Deno, Bun, and browsers!\r\n```\r\n\r\n### 👷 Web Worker Import (For background processing)\r\n\r\n```typescript\r\nimport {\r\n  EdgeTTS,\r\n  Communicate,\r\n  postAudioMessage,\r\n} from 'edge-tts-universal/webworker';\r\n```\r\n\r\n### 🌐 CDN Import (No build step required)\r\n\r\n```html\r\n<!-- Via unpkg -->\r\n<script type=\"module\">\r\n  import { EdgeTTS } from 'https://unpkg.com/edge-tts-universal/dist/browser.js';\r\n</script>\r\n\r\n<!-- Via jsdelivr -->\r\n<script type=\"module\">\r\n  import { EdgeTTS } from 'https://cdn.jsdelivr.net/npm/edge-tts-universal/dist/browser.js';\r\n</script>\r\n```\r\n\r\n## Bundle Optimization\r\n\r\nChoose the right entry point for optimal bundle size:\r\n\r\n| Entry Point                     | Bundle Size\\* | Use Case       | Dependencies    |\r\n| ------------------------------- | ------------- | -------------- | --------------- |\r\n| `edge-tts-universal`            | ~46KB         | Node.js apps   | All deps        |\r\n| `edge-tts-universal/browser`    | ~30KB         | Browser apps   | Zero deps       |\r\n| `edge-tts-universal/isomorphic` | ~36KB         | Universal apps | Isomorphic deps |\r\n| `edge-tts-universal/webworker`  | ~36KB         | Web Workers    | Isomorphic deps |\r\n\r\n_\\* Minified + Gzipped estimates_\r\n\r\n## Quick Start\r\n\r\n### Simple API (Recommended for most use cases)\r\n\r\n```typescript\r\nimport { EdgeTTS } from 'edge-tts-universal';\r\nimport fs from 'fs/promises';\r\n\r\n// Simple one-shot synthesis\r\nconst tts = new EdgeTTS('Hello, world!', 'en-US-EmmaMultilingualNeural');\r\nconst result = await tts.synthesize();\r\n\r\n// Save audio file\r\nconst audioBuffer = Buffer.from(await result.audio.arrayBuffer());\r\nawait fs.writeFile('output.mp3', audioBuffer);\r\n```\r\n\r\n### Advanced Streaming API (For real-time processing)\r\n\r\n```typescript\r\nimport { Communicate } from 'edge-tts-universal';\r\nimport fs from 'fs/promises';\r\n\r\nconst communicate = new Communicate('Hello, world!', {\r\n  voice: 'en-US-EmmaMultilingualNeural',\r\n});\r\n\r\nconst buffers: Buffer[] = [];\r\nfor await (const chunk of communicate.stream()) {\r\n  if (chunk.type === 'audio' && chunk.data) {\r\n    buffers.push(chunk.data);\r\n  }\r\n}\r\n\r\nawait fs.writeFile('output.mp3', Buffer.concat(buffers));\r\n```\r\n\r\n### Isomorphic API (Universal - works in Node.js and browsers)\r\n\r\n```typescript\r\nimport { IsomorphicCommunicate } from 'edge-tts-universal';\r\n\r\n// Works in both Node.js and browsers (subject to CORS policy)\r\nconst communicate = new IsomorphicCommunicate('Hello, universal world!', {\r\n  voice: 'en-US-EmmaMultilingualNeural',\r\n});\r\n\r\nconst audioChunks: Buffer[] = [];\r\nfor await (const chunk of communicate.stream()) {\r\n  if (chunk.type === 'audio' && chunk.data) {\r\n    audioChunks.push(chunk.data);\r\n  }\r\n}\r\n\r\n// Environment-specific handling\r\nconst isNode = typeof process !== 'undefined' && process.versions?.node;\r\nif (isNode) {\r\n  // Node.js - save to file\r\n  const fs = await import('fs/promises');\r\n  await fs.writeFile('output.mp3', Buffer.concat(audioChunks));\r\n} else {\r\n  // Browser - create audio element\r\n  const audioBlob = new Blob(audioChunks, { type: 'audio/mpeg' });\r\n  const audioUrl = URL.createObjectURL(audioBlob);\r\n  // Use audioUrl with <audio> element\r\n}\r\n```\r\n\r\n## Usage Examples\r\n\r\n<details>\r\n<summary><strong>⚡ Simple API Usage (Recommended)</strong></summary>\r\n\r\nHere's how to use the simple, promise-based API for quick synthesis:\r\n\r\n```typescript\r\n// examples/simple-api.ts\r\nimport { EdgeTTS, createVTT, createSRT } from 'edge-tts-universal';\r\nimport { promises as fs } from 'fs';\r\nimport path from 'path';\r\n\r\nconst TEXT = 'Hello, world! This is a test of the simple edge-tts API.';\r\nconst VOICE = 'en-US-EmmaMultilingualNeural';\r\nconst OUTPUT_FILE = path.join(__dirname, 'simple-test.mp3');\r\n\r\nasync function main() {\r\n  // Create TTS instance with prosody options\r\n  const tts = new EdgeTTS(TEXT, VOICE, {\r\n    rate: '+10%',\r\n    volume: '+0%',\r\n    pitch: '+0Hz',\r\n  });\r\n\r\n  try {\r\n    // Synthesize speech (one-shot)\r\n    const result = await tts.synthesize();\r\n\r\n    // Save audio file\r\n    const audioBuffer = Buffer.from(await result.audio.arrayBuffer());\r\n    await fs.writeFile(OUTPUT_FILE, audioBuffer);\r\n\r\n    // Generate subtitle files\r\n    const vttContent = createVTT(result.subtitle);\r\n    const srtContent = createSRT(result.subtitle);\r\n\r\n    await fs.writeFile('subtitles.vtt', vttContent);\r\n    await fs.writeFile('subtitles.srt', srtContent);\r\n\r\n    console.log(`Audio saved to ${OUTPUT_FILE}`);\r\n    console.log(`Generated ${result.subtitle.length} word boundaries`);\r\n  } catch (error) {\r\n    console.error('Synthesis failed:', error);\r\n  }\r\n}\r\n\r\nmain().catch(console.error);\r\n```\r\n\r\n</details>\r\n\r\n<details>\r\n<summary><strong>📁 Advanced Streaming Usage</strong></summary>\r\n\r\nHere is an example using the advanced streaming API for real-time processing:\r\n\r\n```typescript\r\n// examples/streaming.ts\r\nimport { Communicate } from 'edge-tts-universal';\r\nimport { promises as fs } from 'fs';\r\nimport path from 'path';\r\n\r\nconst TEXT =\r\n  'Hello, world! This is a test of the new edge-tts Node.js library.';\r\nconst VOICE = 'en-US-EmmaMultilingualNeural';\r\nconst OUTPUT_FILE = path.join(__dirname, 'test.mp3');\r\n\r\nasync function main() {\r\n  const communicate = new Communicate(TEXT, { voice: VOICE });\r\n\r\n  const buffers: Buffer[] = [];\r\n  for await (const chunk of communicate.stream()) {\r\n    if (chunk.type === 'audio' && chunk.data) {\r\n      buffers.push(chunk.data);\r\n    }\r\n  }\r\n\r\n  const finalBuffer = Buffer.concat(buffers);\r\n  await fs.writeFile(OUTPUT_FILE, finalBuffer);\r\n\r\n  console.log(`Audio saved to ${OUTPUT_FILE}`);\r\n}\r\n\r\nmain().catch(console.error);\r\n```\r\n\r\n</details>\r\n\r\n<details>\r\n<summary><strong>🎤 Listing and Finding Voices</strong></summary>\r\n\r\nYou can list all available voices and filter them by criteria.\r\n\r\n```typescript\r\n// examples/listVoices.ts\r\nimport { VoicesManager } from 'edge-tts-universal';\r\n\r\nasync function main() {\r\n  const voicesManager = await VoicesManager.create();\r\n\r\n  // Find all English voices\r\n  const voices = voicesManager.find({ Language: 'en' });\r\n  console.log(\r\n    'English voices:',\r\n    voices.map((v) => v.ShortName)\r\n  );\r\n\r\n  // Find female US voices\r\n  const femaleUsVoices = voicesManager.find({\r\n    Gender: 'Female',\r\n    Locale: 'en-US',\r\n  });\r\n  console.log(\r\n    'Female US voices:',\r\n    femaleUsVoices.map((v) => v.ShortName)\r\n  );\r\n}\r\n\r\nmain().catch(console.error);\r\n```\r\n\r\n</details>\r\n\r\n<details>\r\n<summary><strong>📺 Streaming with Subtitles (WordBoundary events)</strong></summary>\r\n\r\nThe `stream()` method provides `WordBoundary` events for generating subtitles.\r\n\r\n```typescript\r\n// examples/streaming.ts\r\nimport { Communicate, SubMaker } from 'edge-tts-universal';\r\n\r\nconst TEXT = 'This is a test of the streaming functionality, with subtitles.';\r\nconst VOICE = 'en-GB-SoniaNeural';\r\n\r\nasync function main() {\r\n  const communicate = new Communicate(TEXT, { voice: VOICE });\r\n  const subMaker = new SubMaker();\r\n\r\n  for await (const chunk of communicate.stream()) {\r\n    if (chunk.type === 'audio' && chunk.data) {\r\n      // Do something with the audio data, e.g., stream it to a client.\r\n      console.log(`Received audio chunk of size: ${chunk.data.length}`);\r\n    } else if (chunk.type === 'WordBoundary') {\r\n      subMaker.feed(chunk);\r\n    }\r\n  }\r\n\r\n  // Get the subtitles in SRT format.\r\n  const srt = subMaker.getSrt();\r\n  console.log('\\nGenerated Subtitles (SRT):\\n', srt);\r\n}\r\n\r\nmain().catch(console.error);\r\n```\r\n\r\n</details>\r\n\r\n## API Reference\r\n\r\n📖 **[Complete API Documentation →](./API.md)**\r\n\r\nThe main exports of the package are:\r\n\r\n**Simple API:**\r\n\r\n- **`EdgeTTS`** - Simple, promise-based TTS class for one-shot synthesis\r\n- **`createVTT`** / **`createSRT`** - Utility functions for subtitle generation\r\n\r\n**Advanced API:**\r\n\r\n- **`Communicate`** - Advanced streaming TTS class for real-time processing\r\n- **`VoicesManager`** - A class to find and filter voices\r\n- **`listVoices`** - A function to get all available voices\r\n- **`SubMaker`** - A utility to generate SRT subtitles from `WordBoundary` events\r\n\r\n**Universal API (Preferred):**\r\n\r\n- **`UniversalEdgeTTS`** - Cross-platform simple TTS using Web standards\r\n- **`UniversalCommunicate`** - Universal streaming TTS for all JavaScript runtimes  \r\n- **`UniversalVoicesManager`** - Cross-platform voice management\r\n- **`listVoicesUniversal`** - Universal voice listing with Web APIs\r\n- **`UniversalDRM`** - Cross-platform security using Web Crypto API\r\n\r\n**Isomorphic API (Legacy, Still Supported):**\r\n\r\n- **`IsomorphicCommunicate`** - Universal TTS class that works in Node.js and browsers\r\n- **`IsomorphicVoicesManager`** - Universal voice management with environment detection  \r\n- **`listVoicesIsomorphic`** - Universal voice listing using cross-fetch\r\n- **`IsomorphicDRM`** - Cross-platform security token generation\r\n\r\n**Common:**\r\n\r\n- **Exception classes** - `NoAudioReceived`, `WebSocketError`, etc.\r\n- **TypeScript types** - Complete type definitions for voices, options, and stream chunks\r\n\r\nAll APIs use the same robust infrastructure including **DRM security handling**, error recovery, and Microsoft Edge authentication features. \r\n\r\n**Universal APIs** (preferred) use native Web standards for maximum compatibility, while **Isomorphic APIs** (legacy) provide backward compatibility. **Node.js APIs** offer full features including proxy support and custom headers.\r\n\r\nFor detailed documentation, examples, and advanced usage patterns, see the [comprehensive API guide](./API.md).\r\n","readmeFilename":"README.md"}