How To Make MP3 of Recording From Voice API
- Voice API
- Python SDK
- 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:
You now have your recording in an MP3 file named 'recording.mp3' on disk, which can be played on any popular MP3 player.