Notebooks
F
Fireworks AI
Audio Streaming Speech To Text

Audio Streaming Speech To Text

fireworks-aifireworks-cookbookarchivedlearntutorialsmachine-learningjupyter-notebooksfunction-callingai-workflowsaudiointegrationsaudio_streaming_speech_to_textproduction-examplesgenerative-aiagentic-systemsrag

Open in Colab

Get Started with Streaming Speech-to-Text

In this notebook, you will learn how to:

  • Open a websocket connection to the Fireworks Streaming Speech-to-Text API;
  • Stream audio to the API;
  • Receive the transcription of the audio stream;

Please note that, the audio stream must be 16000 Hz mono audio chunks representing intervals of 50ms or greater.

Install dependencies

[ ]

1. Prepare audio stream

In this example, we will use a pre-recorded audio file and convert it to a stream of audio chunks each 50ms long.

[ ]

2. Stream audio and get transcription

We will store transcription segments in a dict, with keys as segment IDs and values as transcription text.

[ ]

Conclusion

In this notebook, you learned how to stream audio to the Streaming Speech-to-Text API and receive the transcription in real-time over a websocket connection.

For more information visit docs.fireworks.ai.

Explore the community or reach out to us in discord.