Live Streaming Audio Transcription
An overview of the Deepgram .NET SDK and Deepgram speech-to-text live streaming.
The .NET SDK
implements a LiveClient at the root of the Deepgram
namespace. This encapsulates a websocket connection to the Deepgram API and returns a class that emits events received from the Deepgram API for consumption by your application.
Installing the SDK
Initiating a Connection
The Connect()
method initiates a connection with the Deepgram API via websocket. You may pass in options for the transcription as well.
Events
The following events are fired by the LiveTranscriptionClient
:
OpenResponse Event
Subscribe to the OpenResponse event by calling the Subscribe()
function.
ResultResponse Event
Subscribe to the ResultResponse event by calling the Subscribe()
function.
MetadataResponse Event
Subscribe to the MetadataResponse event by calling the Subscribe()
function.
SpeechStartedResponse Event
Subscribe to the SpeechStartedResponse event by calling the Subscribe()
function.
UtteranceEndResponse Event
Subscribe to the UtteranceEndResponse event by calling the Subscribe()
function.
CloseResponse Event
Subscribe to the CloseResponse event by calling the Subscribe()
function.
ErrorResponse Event
Subscribe to the ErrorResponse event by calling the Subscribe()
function.
UnhandledResponse Event
Subscribe to the UnhandledResponse event by calling the Subscribe()
function.
Functions
These functions provide capabilities that make up the LiveClient API.
Sending Data
The Send
method sends raw audio data to the Deepgram API.
Get Websocket State
The State
method returns the ready state of the websocket connection to Deepgram.
Stop Transcribing
The Stop
method sends a signal to the Deepgram API that you have finished streaming audio, and it should conclude its transcription efforts. Upon sending the final transcript back, it will close the websocket connection.