Objective
How To Make MP3 of Recording From Voice API
Applies To
- Voice API
- Python SDK
Procedure
- You can follow the steps to get the recording into a variable within your Python script.
- Once you have the audio in a variable (recording) in the example below, you can write it to a file using the code following the comment: # how to write recording to file.
recording = voice.get_recording("https://api-us.nexmo.com/v1/files/example-9009-4412-a31c-8380fcad6ac2")
# how to write recording to file
file = 'recording.mp3'
with open(file, 'wb') as f:
f.write(recording)
You now have your recording in an MP3 file named 'recording.mp3' on disk, which can be played on any popular MP3 player.
Articles in this section
- Do we retry if the voice event webhook fails?
- How do I verify that the Voice API Webhook request and it's payload has not been tampered during transit?
- How To Check Call Quality With Voice Inspector
- What is a Conversation ID?
- How to configure the custom webhook timeout for Voice API functionality and what are the allowed timeout ranges ?
- How do I change TTL for the Conversations and Call Legs?
- Why are call progress events not being received on the Event URL defined in the conversation action NCCO?
- Why is there an extended silence at the beginning of a call and how can it be reduced?
- Intermittent WebSocket Disconnections
- What Is An NCCO