{"id":49400172,"url":"https://github.com/avimehenwal/web-speech-api","last_synced_at":"2026-04-28T17:31:00.677Z","repository":{"id":346539248,"uuid":"1190397290","full_name":"avimehenwal/web-speech-api","owner":"avimehenwal","description":"Project to demonstrate usage of web APIs to deal with voice data","archived":false,"fork":false,"pushed_at":"2026-03-24T14:33:43.000Z","size":10439,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":0,"default_branch":"main","last_synced_at":"2026-03-25T11:51:21.919Z","etag":null,"topics":["voice","web"],"latest_commit_sha":null,"homepage":"https://avimehenwal.github.io/web-speech-api/","language":"JavaScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/avimehenwal.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"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,"notice":null,"maintainers":null,"copyright":null,"agents":null,"dco":null,"cla":null}},"created_at":"2026-03-24T08:43:47.000Z","updated_at":"2026-03-24T14:35:44.000Z","dependencies_parsed_at":null,"dependency_job_id":null,"html_url":"https://github.com/avimehenwal/web-speech-api","commit_stats":null,"previous_names":["avimehenwal/web-speech-api"],"tags_count":null,"template":false,"template_full_name":null,"purl":"pkg:github/avimehenwal/web-speech-api","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/avimehenwal%2Fweb-speech-api","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/avimehenwal%2Fweb-speech-api/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/avimehenwal%2Fweb-speech-api/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/avimehenwal%2Fweb-speech-api/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/avimehenwal","download_url":"https://codeload.github.com/avimehenwal/web-speech-api/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/avimehenwal%2Fweb-speech-api/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":32392204,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-04-28T14:34:11.604Z","status":"ssl_error","status_checked_at":"2026-04-28T14:32:37.009Z","response_time":56,"last_error":"SSL_read: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"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":["voice","web"],"created_at":"2026-04-28T17:30:59.931Z","updated_at":"2026-04-28T17:31:00.670Z","avatar_url":"https://github.com/avimehenwal.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# 🎙 Speech API Lab\n\nA **Text-to-Speech** and **Speech Recognition** demo built with **React 18 + Vite**, using the browser-native [Web Speech API](https://developer.mozilla.org/en-US/docs/Web/API/Web_Speech_API). No backend, no external AI service — everything runs locally in your browser.\n\n---\n\n## 🌐 Live Demo\n\n**[https://avimehenwal.github.io/web-speech-api/](https://avimehenwal.github.io/web-speech-api/)**\n\n\u003e Automatically deployed from the `main` branch via GitHub Actions.\n\n[![Deploy to GitHub Pages](https://github.com/avimehenwal/web-speech-api/actions/workflows/gh-pages.yml/badge.svg)](https://github.com/avimehenwal/web-speech-api/actions/workflows/gh-pages.yml)\n\n---\n\n## Screenshots\n\u003ctable\u003e\n  \u003ctr\u003e\n    \u003cth align=\"center\"\u003eText-to-Speech Demo\u003c/th\u003e\n    \u003cth width=\"32\"\u003e\u003c/th\u003e\n    \u003cth align=\"center\"\u003eSpeech Recognition Demo\u003c/th\u003e\n  \u003c/tr\u003e\n  \u003ctr\u003e\n    \u003ctd align=\"center\" valign=\"top\"\u003e\n      \u003cimg src=\"./asset/TTS.png\" alt=\"Text-to-Speech demo screen\" height=\"420\" /\u003e\n    \u003c/td\u003e\n    \u003ctd width=\"32\"\u003e\u003c/td\u003e\n    \u003ctd align=\"center\" valign=\"top\"\u003e\n      \u003cimg src=\"./asset/STT.png\" alt=\"Speech Recognition demo screen\" height=\"420\" /\u003e\n    \u003c/td\u003e\n  \u003c/tr\u003e\n\u003c/table\u003e\n\n## ✨ Features\n\n| Feature                     | Details                                                                                                    |\n| --------------------------- | ---------------------------------------------------------------------------------------------------------- |\n| **Text-to-Speech**          | Voice picker, rate / pitch / volume sliders, play / pause / resume / stop, live word-boundary highlighting |\n| **Speech Recognition**      | Continuous or single-shot mode, 12 language options, interim + final transcript, confidence score          |\n| **React hooks**             | `useTTS` and `useSpeechRecognition` — clean, reusable, easy to extend                                      |\n| **No build-time API calls** | 100% client-side Web Speech API                                                                            |\n\n---\n\n## 🖥 Browser support\n\n| Feature                                  | Chrome | Edge | Safari | Firefox |\n| ---------------------------------------- | ------ | ---- | ------ | ------- |\n| Text-to-Speech (`SpeechSynthesis`)       | ✅      | ✅    | ✅      | ✅       |\n| Speech Recognition (`SpeechRecognition`) | ✅      | ✅    | ✅      | ❌       |\n\n\u003e **Tip:** For the best experience, use **Chrome** or **Edge** — they support both APIs and expose the most voices.\n\n---\n\n## 🚀 Running locally\n\n### Prerequisites\n\n- [Node.js](https://nodejs.org/) **v18 or newer** (run `node -v` to check)\n- **npm** (comes with Node) or **pnpm** / **yarn**\n\n### Steps\n\n```bash\n# 1. Enter the project folder\ncd speech-api-lab\n\n# 2. Install dependencies  (~30 seconds)\nnpm install\n\n# 3. Start the dev server\nnpm run dev\n```\n\nThen open **http://localhost:5173** in your browser.\n\n\u003e The page auto-reloads whenever you edit a source file.\n\n### Other commands\n\n```bash\nnpm run build    # Production build → ./dist/\nnpm run preview  # Serve the production build locally\n```\n\n---\n\n## 📁 Project structure\n\n```\nspeech-api-lab/\n├── index.html                  # HTML entry point\n├── vite.config.js              # Vite configuration\n├── package.json\n└── src/\n    ├── main.jsx                # React root mount\n    ├── App.jsx                 # App shell, tab navigation\n    ├── index.css               # Global CSS variables \u0026 animations\n    ├── hooks/\n    │   ├── useTTS.js           # ← All Text-to-Speech logic\n    │   └── useSpeechRecognition.js  # ← All Speech Recognition logic\n    └── components/\n        ├── UI.jsx              # Shared primitives (Slider, Btn, StatusBar…)\n        ├── TTSPanel.jsx        # Text-to-Speech tab\n        ├── SRPanel.jsx         # Speech Recognition tab\n        └── CodeSnippet.jsx     # Collapsible code viewer\n```\n\n---\n\n## 🔧 Extending the app\n\n### Add a new TTS feature (e.g. highlight full sentences)\n\nEdit **`src/hooks/useTTS.js`** — the `onboundary` handler fires for both `\"word\"` and `\"sentence\"` boundary events:\n\n```js\nutt.onboundary = (e) =\u003e {\n  if (e.name === 'sentence') setCurrentSentence(text.substr(e.charIndex, e.charLength))\n}\n```\n\n### Add more Speech Recognition languages\n\nEdit the `LANGUAGES` array in **`src/components/SRPanel.jsx`**:\n\n```js\n{ code: 'ru-RU', label: 'Russian' },\n{ code: 'nl-NL', label: 'Dutch' },\n```\n\n### Pipe SR transcript into TTS\n\nIn **`src/App.jsx`**, lift the transcript state up and pass it as the initial text prop to `\u003cTTSPanel\u003e`.\n\n---\n\n## 📦 Dependencies\n\n| Package                | Purpose                |\n| ---------------------- | ---------------------- |\n| `react` + `react-dom`  | UI framework           |\n| `vite`                 | Dev server \u0026 bundler   |\n| `@vitejs/plugin-react` | JSX transform for Vite |\n\nZero runtime dependencies beyond React itself.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Favimehenwal%2Fweb-speech-api","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Favimehenwal%2Fweb-speech-api","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Favimehenwal%2Fweb-speech-api/lists"}