Yes, Deepgram supports sentiment analysis for pre-recorded audio, but not for real-time (live/streaming) audio. You can enable sentiment analysis directly in your transcription request by adding the parameter sentiment=true to your API call. There is no need for a separate endpoint; you simply include this parameter in your request to the /listen endpoint for pre-recorded audio.
Here’s an example using cURL for a pre-recorded audio file:
curl \
--request POST \
--header 'Authorization: Token YOUR_DEEPGRAM_API_KEY' \
--header 'Content-Type: audio/wav' \
--data-binary @youraudio.wav \
--url '<https://api.deepgram.com/v1/listen?sentiment=true'>
Replace YOUR_DEEPGRAM_API_KEY with your Deepgram API key and youraudio.wav with your audio file. The response will include sentiment analysis results along with the transcription, as long as the audio is in English (sentiment analysis currently only supports English) Sentiment Analysis Docs.
If you want to maximize throughput or decouple transcription and sentiment analysis, you can first transcribe the audio and then use Deepgram’s Text Intelligence API to analyze the resulting transcript for sentiment How do I maximize my intelligence throughput?.
Note: Sentiment analysis is not available for live/streaming audio; it is only supported for pre-recorded audio files Does Deepgram Speech to Text support sentiment analysis?.
Note: you can ask me a follow up question by @ mentioning me again :speech_balloon: