Skip to content

audio mp4 support? #188

Closed Answered by jjmaldonis
vivekr93 asked this question in General help
Discussion options

You must be logged in to vote

Hey @vivekr93, rather than use the files=... parameter in requests.post, you can use the data=<binary audio data> parameter. Below is a complete python script that loads an audio file from disk and sends it to Deepgram for processing (you will need to replace the API key with your own).

from typing import Any
import requests
import os


DEEPGRAM_API_KEY = os.environ["DEEPGRAM_API_KEY"]  # Your Deepgram API Key


def send_audio_to_nova(blob: Any, audio_type) -> str:
    url = "https://api.deepgram.com/v1/listen?model=nova"
    headers = {}
    headers["Authorization"] = f"Token {DEEPGRAM_API_KEY}"
    headers["Content-Type"] = audio_type
    print("audio_type: ", audio_type)

    try:
    …

Replies: 1 comment

Comment options

You must be logged in to vote
0 replies
Answer selected by jkroll-deepgram
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
2 participants