With Twilio Media Streams, you can extend the capabilities of Twilio-powered voice application with real time access to the raw audio stream of phone calls. For example, we can build tools that transcribe the speech using DeepgramAI from a phone call live into a browser window, run sentiment analysis of the speech on a phone call or even use voice biometrics to identify individuals.
Before we can get started, you’ll need to make sure to have:
- A Free Twilio Account
- A Deepgram Account
- Installed ngrok
-
Modify the
.env.sample
file to include the Deepgram API keys and save it as a.env
file -
Run the following commands:
Start ngrok:
$ ngrok http 8080
While this is running in a new window copy the forwarding HTTPS URL (https://xxxxx.ngrok.io) and configure the Voice url of the number in your Twilio console. not this is for Inbound calls
Install dependencies and start your server:
$ npm install
$ npm start