Getting Started with Live Streaming Audio

¿Prefieres español? Ver Tutorial para transcribir audio en vivo.

In this guide, you’ll learn how to automatically transcribe live streaming audio in real time using Deepgram’s SDKs, which are supported for use with the Deepgram API.

Before You Begin

Before you run the code, you’ll need to do a few things.

Create a Deepgram Account

Before you can use Deepgram products, you’ll need to create a Deepgram account. Signup is free and includes:

Create a Deepgram API Key

To access Deepgram’s API, you’ll need to create a Deepgram API Key. Make note of your API Key; you will need it later.

Configure Environment

We provide sample scripts in Python and Node.js and assume you have already configured either a Python or Node development environment. System requirements will vary depending on the programming language you use:

  • Node.js: node >= 14.14.37, cross-fetch >= 3.1.5
  • Python: python >= 3.7, aiohttp >= 3.8.1

If you get stuck at any point, help is just a click away! Contact Support.

Transcribe Audio

Once you have your API Key, it’s time to transcribe audio!

If you want a quick way to get up and running, our Python streaming test suite provides sample code to help you get started. Before beginning to build your own integration, we recommend running the test suite code at least once to ensure you can successfully stream sample audio to Deepgram.

If you’d like to follow a step-by-step tutorial, our instructions below will guide you through the process of creating a sample application, installing the Deepgram SDK, configuring code with your own Deepgram API Key and streaming audio to transcribe, and finally, building and running the application.

Install the SDK

Open your terminal, navigate to the location on your drive where you want to create your project, and install the Deepgram SDK:

Example

Add Dependencies

Add necessary external dependencies to your project.

Example

Write the Code

In your terminal, create a new file in your project’s location, and populate it with code.

Example

Be sure to replace YOUR_DEEPGRAM_API_KEY with your Deepgram API Key.

Start the Application

Run the application from the terminal.

Example

Be sure to replace YOUR_PROJECT_NAME with the name of the file to which you saved the code in the previous step.

See Results

Your transcripts will appear in your browser’s developer console.

Deepgram does not store transcriptions. Make sure to save output or return transcriptions to a callback URL for custom processing.

By default, Deepgram live streaming looks for any deviation in the natural flow of speech and returns a finalized response at these places. To learn more about this feature, see Endpointing.

Deepgram live streaming can also return a series of interim transcripts followed by a final transcript. To learn more, see Interim Results.

Endpointing can be used with Deepgram’s Interim Results feature. To compare and contrast these features, and to explore best practices for using them together, see Using Endpointing and Interim Results with Live Streaming Audio.

What’s Next?

Now that you’ve gotten transcripts for streaming audio, enhance your knowledge by exploring the following areas.

Customize Transcripts

To customize the transcripts you receive, you can send a variety of parameters to the Deepgram API.

For example, if your audio is in Spanish rather than UK English, you can pass the language: parameter with the es option to the transcription.live method in the previous examples.

Example

To learn more about the languages available with Deepgram, see the Language feature guide. To learn more about the many ways you can customize your results with Deepgram’s API, check out the Deepgram API Reference.

Add Your Audio

Ready to connect Deepgram to your own audio source? Start by reviewing how to determine your audio format and format your API request accordingly.

Then, you’ll want to check out our streaming test suite. The streaming test suite is the perfect “102” introduction to integrating your own audio.

Explore Use Cases

Time to learn about the different ways you can use Deepgram products to help you meet your business objectives. Explore Deepgram’s use cases.

Transcribe Pre-recorded Audio

Now that you know how to transcribe streaming audio, check out how you can use Deepgram to transcribe pre-recorded audio. To learn more, see Getting Started with Pre-recorded Audio.

Share your feedback

Thank you! Can you tell us what you liked about it? (Optional)

Thank you. What could we have done better? (Optional)

We may also want to contact you with updates or questions related to your feedback and our product. If don't mind, you can optionally leave your email address along with your comments.

Thank you!

We appreciate your response.