{"id":27634969,"url":"https://github.com/willwade/js-tts-demo","last_synced_at":"2025-06-10T17:10:02.959Z","repository":{"id":287009157,"uuid":"963129257","full_name":"willwade/js-tts-demo","owner":"willwade","description":"A demo to show off js-tts-wrapper","archived":false,"fork":false,"pushed_at":"2025-05-27T13:18:54.000Z","size":588,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-05-27T13:48:19.786Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"TypeScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/willwade.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,"zenodo":null}},"created_at":"2025-04-09T07:48:15.000Z","updated_at":"2025-05-27T13:18:58.000Z","dependencies_parsed_at":"2025-05-27T13:32:21.407Z","dependency_job_id":"80cac1bd-457f-41a7-bb0d-ff30c01c079a","html_url":"https://github.com/willwade/js-tts-demo","commit_stats":null,"previous_names":["willwade/js-tts-demo"],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/willwade%2Fjs-tts-demo","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/willwade%2Fjs-tts-demo/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/willwade%2Fjs-tts-demo/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/willwade%2Fjs-tts-demo/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/willwade","download_url":"https://codeload.github.com/willwade/js-tts-demo/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/willwade%2Fjs-tts-demo/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":259114577,"owners_count":22807252,"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","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":[],"created_at":"2025-04-23T19:40:06.885Z","updated_at":"2025-06-10T17:10:02.951Z","avatar_url":"https://github.com/willwade.png","language":"TypeScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# TTS Demo Web Application\n\nThis is a web-based demonstration of the `js-tts-wrapper` library, showcasing its capabilities for text-to-speech synthesis across multiple engines.\n\n## Features\n\n- Support for multiple TTS engines:\n  - Azure Cognitive Services\n  - ElevenLabs\n  - Google Cloud TTS\n  - OpenAI TTS\n  - PlayHT\n  - AWS Polly\n  - SherpaOnnx (server-side TTS)\n  - SherpaOnnx WebAssembly (browser-based TTS)\n  - eSpeak (server-side open-source TTS)\n  - eSpeak WebAssembly (browser-based open-source TTS)\n  - IBM Watson TTS\n  - Wit.ai TTS\n  - Mock TTS (for testing and development)\n\n- User-friendly interface with:\n  - Credentials management\n  - Voice selection\n  - Text-to-speech playback\n  - Audio download\n\n## Getting Started\n\n### Prerequisites\n\n- Node.js 18+ and npm/pnpm\n- API keys for the TTS services you want to use\n\n### Installation\n\n1. Install dependencies:\n   ```bash\n   cd js-tts-demo\n   npm install\n   # or\n   pnpm install\n   ```\n\n2. Install WebAssembly server dependencies:\n   ```bash\n   cd wasm-server\n   npm install\n   # or\n   pnpm install\n   ```\n\n2. Create a `.env.local` file with your API keys:\n   ```\n   # Azure TTS\n   MICROSOFT_TOKEN=your_azure_key\n   MICROSOFT_REGION=your_azure_region\n\n   # ElevenLabs\n   ELEVENLABS_API_KEY=your_elevenlabs_key\n\n   # Google TTS\n   GOOGLE_SA_PATH=path_to_google_service_account_json\n\n   # OpenAI\n   OPENAI_API_KEY=your_openai_key\n\n   # PlayHT\n   PLAYHT_API_KEY=your_playht_key\n   PLAYHT_USER_ID=your_playht_user_id\n\n   # AWS Polly\n   POLLY_REGION=your_aws_region\n   POLLY_AWS_KEY_ID=your_aws_key_id\n   POLLY_AWS_ACCESS_KEY=your_aws_secret_key\n   ```\n\n3. Download the WebAssembly modules:\n   ```bash\n   ./scripts/download-sherpaonnx-wasm.sh\n   ```\n\n4. Start the development server with WebAssembly support:\n   ```bash\n   npm run dev:with-wasm\n   # or\n   pnpm dev:with-wasm\n   ```\n\n   Alternatively, to run with both SherpaOnnx server and WebAssembly support:\n   ```bash\n   npm run dev:full\n   # or\n   pnpm dev:full\n   ```\n\n4. Open [http://localhost:3000](http://localhost:3000) in your browser.\n\n## Usage\n\n1. **Credentials Tab**: Enable/disable TTS engines and configure API keys\n2. **Voices Tab**: Browse and select voices from different TTS engines\n3. **Playback Tab**: Enter text, generate speech, and play/download audio\n\n## Architecture\n\n- Next.js 14 application with App Router\n- React components with Tailwind CSS and shadcn/ui\n- Server-side API routes for TTS processing\n- Integration with js-tts-wrapper library\n- WebAssembly-based TTS engine for browser-based speech synthesis\n- Express server for serving WebAssembly modules\n\n## Notes\n\n- This demo is for demonstration purposes only\n- API keys are stored in environment variables for security\n## SherpaOnnx Setup\n\n### Server-side SherpaOnnx\n\nSherpaOnnx is a native library that requires specific environment variables to be set correctly based on the operating system:\n\n- On macOS: `DYLD_LIBRARY_PATH`\n- On Linux: `LD_LIBRARY_PATH`\n- On Windows: `PATH`\n\nThe scripts in this project automatically set these environment variables for you when you use the provided npm scripts.\n\n### Browser-based SherpaOnnx WebAssembly\n\nThe WebAssembly version of SherpaOnnx runs directly in the browser without requiring native libraries or environment variables. This makes it ideal for web applications that need offline TTS capabilities.\n\nTo use the WebAssembly version:\n\n1. Download the pre-built WebAssembly modules using the provided script:\n   ```bash\n   ./scripts/download-sherpaonnx-wasm.sh\n   ```\n\n2. Start the WebAssembly server:\n   ```bash\n   npm run wasm-server\n   # or\n   pnpm wasm-server\n   ```\n\n3. Use the WebAssembly TTS engine in your application.\n\n### For DigitalOcean App Platform\n\nIf you're deploying to DigitalOcean App Platform, use the following commands:\n\n```bash\n# For building\nnpm run build:do\n# or\nyarn build:do\n# or\npnpm build:do\n\n# For starting the server\nnpm run start:do\n# or\nyarn start:do\n# or\npnpm start:do\n```\n\nAlternatively, you can set the environment variable in the DigitalOcean App Platform dashboard:\n\n1. Go to your app in the DigitalOcean dashboard\n2. Navigate to the Settings tab\n3. Under \"Environment Variables\", add:\n   - Key: `LD_LIBRARY_PATH`\n   - Value: `/workspace/node_modules/sherpa-onnx-linux-x64:$LD_LIBRARY_PATH`\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fwillwade%2Fjs-tts-demo","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fwillwade%2Fjs-tts-demo","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fwillwade%2Fjs-tts-demo/lists"}