How to push audio from Node.js and use Symbl real-time API to subscribe to real-time data
#
Getting startedThis example runs on node server, so we will use symbl-node
package.
Open .env
file and add your APP_ID, APP_SECRET, SUMMARY_EMAIL. You can get
APP_ID and APP_SECRET from https://platform.symbl.ai
For demo purposes, we're using mic
to simply get audio from microphone and pass
it on to websocket connection
We use mic
module so make sure you check that all requirements for the package
are met. For instance we need sox
package or ALSA
tools to be installed.
mic
installation instructions: https://www.npmjs.com/package/mic#installation
on Mac it can be as simple as running brew install sox
#
Initialize SDKWe will also need a unique id to associate to our Symbl request. We will create
this Id using uuid
package
const id = uuid();
Now we can start the connection using sdk.startRealtimeRequest
. We need to
provide several important options to our realtime request.
insightTypes
- we need to provide which insights will be detected. Supported ones areaction_item
andquestion
.config
object with meeting title, confidence treshold and the sampleRatespeaker
object to define who is the speaker. To distinguish between different speakers we also need to provideuserId
with valid email, so after meeting will end, we will receive summary emailhandlers
- these handlers are used to detect speach, messages and insights.onSpeechDetected
- This will return live transcription of the callonMessageResponse
- When processed messages are available, this callback will be calledonInsightResponse
- When Symbl detects an insight, this callback will be called.
So our complete code will look like this: