Live Streaming Audio Transcription

The function encapsulates a websocket connection to the Deepgram API and returns a Node.js event emitter. Events received from the Deepgram API are emitted for consumption by your application.


Additional options can be provided for streaming transcriptions. They are provided as an object of the function. Each of these parameters map to a feature in the Deepgram API. Reference the
features documentation to learn what features may be appropriate for your request.

Initiating a Connection

The function will return a Node.js event emitter that your application can subscribe to events on.

const deepgramLive ={
	punctuate: true,
	// additional options


The following events are fired by the live transcription object:

openThe websocket connection to Deepgram has been opened.The DG live transcription object
closeThe websocket connection to Deepgram has been closed.WebSocket.CloseEvent
errorAn error occurred with the websocket connectionError object
transcriptReceivedDeepgram has responded with a transcriptionTranscription response

Listening to Events

Use the addListener function to listen for events fired on the object returned from the function.

deepgramLive.addListener("transcriptReceived", (transcription) => {


The object returned by the function provides several functions to make using the Deepgram API easier. They are send, getReadyState, toggleNumerals, and finish.

Sending Data

The send function sends raw audio data to the Deepgram API.


Get Ready State

The getReadyState function returns the ready state of the websocket connection to Deepgram.

const websocketReadyState = deepgramLive.getReadyState();

Toggle Features

The configure function gives the ability to toggle different features. Currently, only the numerals feature is supported with plans to add more in the future. The function takes in an object with features to toggle to determine whether or not to enable the feature.

deepgramLive.configure({numerals: true}); // enable numerals
deepgramLive.configure({numerals: false}); // disable numerals

This function is a shorthand way of sending the following data to the websocket connection:

		type: "Configure",
		processors: {
			numerals: true, // or false

Closing the Connection

The finish function closes the Websocket connection to Deepgram.