
SpeechToText
by marimo team
Convert voice input to text using the browser's speech recognition.
About this notebook
This notebook transcribes speech to text inside the browser. It uses the free webkit speech API, so the data is live audio from your microphone. There is no fixed dataset. The notebook imports marimo and the WebkitSpeechToTextWidget from the wigglystuff library. Not every browser may support this API.
You speak into the microphone and the widget shows the transcription live. The notebook wraps the widget with mo.ui.anywidget so marimo can read its state. A second cell reads speech_widget.transcript and passes the text to Python. You can also start and stop the recording from Python. Two buttons, "Start Recording" and "End Recording", set the widget listening flag to True or False.
The transcription runs in the browser through the webkit speech API. No server model or GPU is needed. The buttons use mo.ui.button with on_click handlers that toggle the listening state on the same widget object.











