{"id":24152353,"url":"https://github.com/nfreear/dictation","last_synced_at":"2025-03-01T19:21:23.330Z","repository":{"id":56193443,"uuid":"302652960","full_name":"nfreear/dictation","owner":"nfreear","description":"An adaptive dictation-mode speech recognizer ponyfill compatible with WebChat that gives the user time to think and stutter!","archived":false,"fork":false,"pushed_at":"2023-11-29T21:23:30.000Z","size":203,"stargazers_count":2,"open_issues_count":13,"forks_count":0,"subscribers_count":3,"default_branch":"main","last_synced_at":"2025-01-12T10:15:42.935Z","etag":null,"topics":["adaptive","asr","recognition","sdk","speech","stammer","stutter","web-api","webchat"],"latest_commit_sha":null,"homepage":"","language":"JavaScript","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/nfreear.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2020-10-09T13:42:18.000Z","updated_at":"2024-12-17T04:06:49.000Z","dependencies_parsed_at":"2022-08-15T14:30:35.807Z","dependency_job_id":null,"html_url":"https://github.com/nfreear/dictation","commit_stats":null,"previous_names":[],"tags_count":3,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/nfreear%2Fdictation","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/nfreear%2Fdictation/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/nfreear%2Fdictation/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/nfreear%2Fdictation/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/nfreear","download_url":"https://codeload.github.com/nfreear/dictation/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":241411917,"owners_count":19958827,"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":["adaptive","asr","recognition","sdk","speech","stammer","stutter","web-api","webchat"],"created_at":"2025-01-12T10:15:46.117Z","updated_at":"2025-03-01T19:21:23.303Z","avatar_url":"https://github.com/nfreear.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"[![Test status][ci-badge]][ci]\n\n# @nfreear/speech-dictation\n\nAn adaptive dictation-mode speech recognizer _ponyfill_ compatible with [WebChat][]\nthat gives the user time to think and stutter (_stammer_)!\n\n\u003e Mastering '`endSilenceTimeoutMs`' in Microsoft [Speech SDK][sdk] dictation mode!\n\n_(08-Oct-2020)_\n\n## Ponyfill\n\nSee [Integrating with Cognitive Services Speech Services][bot-speech].\n\n```javascript\nimport { createDictationRecognizerPonyfill } from './createDictationRecognizerPonyfill.js';\n\nconst asrPonyfill = await createDictationRecognizerPonyfill({ region, key });\n\n// ... Combine speech synthesis from default\n// 'createCognitiveServicesSpeechServicesPonyfillFactory()' ...\n\nrenderWebChat(\n  {\n    directLine: createDirectLine({ ... }),\n    // ...\n    webSpeechPonyfillFactory: await createCustomHybridPonyfill({ ... })\n  },\n  document.getElementById('webchat')\n);\n```\n\n## Dictation mode\n\nThe key lines in `createDictationRecognizerPonyfill` to force dictation mode,\nand enable the setting of `initialSilenceTimeoutMs` and `endSilenceTimeoutMs`:\n\n```javascript\nconst initialSilenceTimeoutMs = 5 * 1000;\nconst endSilenceTimeoutMs = 5 * 1000;\n// Scroll to right! → →\nconst url = `wss://${region}.stt.speech.microsoft.com/speech/recognition/dictation/cognitiveservices/v1?initialSilenceTimeoutMs=${initialSilenceTimeoutMs || ''}\u0026endSilenceTimeoutMs=${endSilenceTimeoutMs}\u0026`;\nconst urlObj = new URL(url);\n\nconst speechConfig = SpeechConfig.fromEndpoint(urlObj, subscriptionKey);\n\nspeechConfig.enableDictation();\n\n// ...\n\nconst recognizer = new SpeechRecognizer(speechConfig, audioConfig);\n```\n\n## Usage\n\n```\nnpm install\nnpm start\nnpm test\n```\n\n## Useful links\n\n * [Gist: `speech-sdk.dictate.js.html`][gist];\n * [Bug: '_Can i set silence duration at end of speech ?_' (#131)][b-131];\n * [Bug: '_... I need to lengthen the dictation / \"Listening\" timeout_' (#3466)][b-3466]\n * [GitHub: Microsoft/cognitive-services-speech-sdk-js][sdk];\n * [GitHub: @compulim/web-speech-cognitive-services `../create...Ponyfill.js`][comp-ponyfill];\n * [GitHub: @compulim/react-dictate-button `../Composer.js`][dict-btn-recog];\n\n## Credit\n\nDeveloped in [IET][] at [The Open University][ou] for the [ADMINS][] project, funded by [Microsoft][ms].\n\n---\n\u003c!-- © 2020 Nick Freear. --\u003e\n\n[c]: https://www.open.ac.uk/copyright \"Copyright © The Open University (IET).\"\n[ou]: http://www.open.ac.uk \"The Open University\"\n[iet]: https://iet.open.ac.uk/ \"Institute of Educational Technology, at The Open University.\"\n[admins]: https://iet.open.ac.uk/projects/admins\n  \"ADMINS in IET: Assistants to the Disclosure and Management of Information about Needs and Support\"\n[ms]: https://microsoft.com/en-gb/ai/ai-for-accessibility-projects#:~:text=ADMINS\n  \"Microsoft 'AI for Accessibility' projects, including ADMINS\"\n\n[gist]: https://gist.github.com/nfreear/f875994f45c97518cd8c42c786998c84\n[b-131]: https://github.com/Azure-Samples/cognitive-services-speech-sdk/issues/131\n[b-3466]: https://github.com/microsoft/BotFramework-WebChat/issues/3466\n[sdk]: https://github.com/microsoft/cognitive-services-speech-sdk-js\n[webchat]: https://github.com/Microsoft/BotFramework-WebChat\n[bot-speech]: https://github.com/Microsoft/BotFramework-WebChat/blob/master/docs/SPEECH.md#integrating-web-chat-into-your-page\n\n[comp-speech]: https://github.com/compulim/web-speech-cognitive-services\n[comp-ponyfill]: https://github.com/compulim/web-speech-cognitive-services/blob/master/packages/component/src/SpeechServices/SpeechToText/createSpeechRecognitionPonyfill.js\n[dict-btn]: https://github.com/compulim/react-dictate-button\n[dict-btn-recog]: https://github.com/compulim/react-dictate-button/blob/v1.2.2/packages/component/src/Composer.js#L134\n\n[ci]: https://github.com/nfreear/dictation/actions \"Test status ~ 'Node CI'\"\n[ci-badge]: https://github.com/nfreear/dictation/workflows/Node%20CI/badge.svg\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fnfreear%2Fdictation","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fnfreear%2Fdictation","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fnfreear%2Fdictation/lists"}