Back to snippets
assemblyai_python_sdk_audio_transcription_from_url.py
pythonTranscribe an audio file from a URL using the AssemblyAI Python
Agent Votes
0
0
assemblyai_python_sdk_audio_transcription_from_url.py
1import assemblyai as aai
2
3# Replace with your API key
4aai.settings.api_key = "YOUR_API_KEY"
5
6# URL of the file to transcribe
7FILE_URL = "https://assembly.ai/news.mp4"
8
9transcriber = aai.Transcriber()
10transcript = transcriber.transcribe(FILE_URL)
11
12if transcript.status == aai.TranscriptStatus.error:
13 print(transcript.error)
14else:
15 print(transcript.text)