How To Make MP3 of Recording From Voice API
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.
Comments
0 comments
Article is closed for comments.