Voice input (dictation) using the Web Speech API
📝 Provide a description of the new feature
What is the expected behavior of the proposed feature?
The problem
People who dictate rather than type have no first-party dictation option in CKEditor 5. They currently rely on OS-level dictation or browser extensions, whose interaction with the editor can be fragile. #15585 is one example of that problem — this proposal is not a fix for that issue, but a separate first-party approach.
What I have
I have built and shipped a Web Speech API dictation plugin for CKEditor 5. It is currently running in production in an HR application, with real users dictating in Persian. The same implementation also supports English.
A toolbar button starts dictation. Recognized text is inserted through CKEditor's insertText command using the current selection, keeping the edit within CKEditor's normal editing flow.
A footer shows the current recognition state and a live microphone level meter so users can tell whether the microphone is active and receiving audio.
Why this is more than a thin Web Speech API wrapper
A naive integration using continuous = true and consuming event.results was not reliable enough for longer dictation sessions.
During development and production usage, we encountered several failure modes, including empty final results, recognition sessions that remained active but stopped producing useful transcripts, restart races around start(), and watchdog logic that could leave a session stuck.
The current implementation explicitly handles these cases and has been used for longer continuous dictation sessions in production. I can provide traces, tests, recordings, and more implementation details if useful.
Known limitations
SpeechRecognitionis not consistently available across all major browsers. The current implementation detects support and disables the feature with an explanation when recognition is unavailable.- Where recognition is performed depends on the browser and platform and may involve a remote recognition service. Experimental Web Speech API capabilities such as
processLocally,SpeechRecognition.available(), andSpeechRecognition.install()also make on-device recognition possible where supported, but this cannot currently be assumed to be available. - The feature requires microphone permission and an appropriate secure browser context.
Questions before I do any porting
- Is first-party dictation something you would consider accepting upstream in CKEditor 5?
- If the feature is useful but not a fit for the main project, would you prefer it to remain a third-party/community plugin?
- Would relying on browser/platform-provided speech recognition be acceptable for a CKEditor feature, or is that itself a blocker for upstream inclusion?
I am willing to adapt the existing implementation to CKEditor's package conventions, coding style, test and coverage requirements, manual tests, accessibility expectations, translations, and maintenance requirements.
Since the existing implementation is substantial and already running in production, I would rather ask about the intended direction before spending time porting it into the CKEditor repository.
Happy to provide a recording, technical traces, or a live demo if that would help evaluate the proposal.
If you'd like to see this feature implemented, add a 👍 reaction to this post.
Hi @shayan-m81,
Thank you for the detailed proposal and for offering to share your work.
Dictation is not something we have planned at the moment, and after considering it we lean towards this staying a community plugin. We would genuinely be glad to see it published, and if you decide to go that way, please do not hesitate to reach out. If you run into anything on the editor side, just ask here and we will gladly help.
Thanks for the clear answer and for taking the time to consider it. That makes sense. I’ll proceed with extracting the implementation as a standalone community plugin and get it into a publishable shape. I’ll follow the CKEditor 5 package conventions, and if I run into any editor-side integration questions, I’ll ask here. Once the plugin is public, I’ll also share the repository/package here.
Thanks again for the offer to help!
Following up on this — thanks for the clear answer about it staying a community plugin.
I've published it as ckeditor5-voice-input:
- npm: https://www.npmjs.com/package/ckeditor5-voice-input
- source: https://github.com/shayan-m81/ckeditor5-voice-input
It adds voice input / dictation to CKEditor 5 using the browser's Web Speech API, with a toolbar control, recognition-state UI, an optional microphone level meter, and Persian support. Recognised text is inserted through CKEditor's normal editing command at the current selection.
A few implementation details that may be useful to anyone finding this issue later:
- CKEditor 5 peer range:
>=48.0.0 <49 - ClassicEditor and InlineEditor are currently covered by integration tests
- no runtime dependencies; ESM-only
- English and Persian translations use CKEditor's translation system
- recognition availability is determined at runtime by the browser
- session handling includes restart/watchdog logic and a bounded retry strategy for longer dictation sessions
This is a community plugin, not an official CKEditor package.
Happy to hear any feedback if something looks wrong from the CKEditor integration side.
This is great to see, thank you for following through and actually publishing it. Taking something from an internal implementation to a released package is real work, and it is nice that you shared it back with the community.
We gave the plugin a try and it works really well. The status bar at the bottom is a particularly nice touch, it makes it easy to see what is happening and what is being dictated. The only thing we noticed is that it uses the default browser font, so it could pick up the editor's font instead for a more consistent look. That is a small detail though, and the plugin is already a useful option for anyone who needs dictation in CKEditor 5.
Good job, and thanks again for building this! If any editor-side questions come up as you develop it further, don't hesitate to ask here.