Use LeMUR with Streaming Speech-to-Text (STT)
This script is modified to contain a global variable conversation_data
that accumulates the transcribed text in the on_data
function. Once the transcription session is closed, the on_close
function sends conversation_data
to LeMUR for analysis using LeMUR’s input_text
parameter.
Quickstart
Step-by-Step Instructions
Install the AssemblyAI Python SDK. To use the microphone stream, you need to install the extras for this SDK. Mac and Linux users also need to install portaudio
before installing the extras.
Mac
Linux
Import the assemblyai
package and set the API key.
Create functions to handle different events during transcription.
In our on_data
function, we append the transcript text to the conversation_data
variable.
In our on_close
function, we send the accumulated conversation_data
to LeMUR for analysis.
Create a RealtimeTranscriber
to set up the Streaming STT configuration.
Begin the Streaming STT transcription process.