Quantcast
Channel: MediaSPIP
Viewing all articles
Browse latest Browse all 118036

Convert ogg audio to wav in python without ffmpeg

$
0
0

I am getting oga file from javascript blob and I want to convert it to PCM compatible wav file in python. The approach I am using is as follow

AudioSegment.converter = r"C:/ffmpeg/bin/ffmpeg.exe"
AudioSegment.ffprobe = r"C:/ffmpeg/bin/ffprobe.exe"
sound = AudioSegment.from_file("file.oga")
sound.export("file.wav", format="wav")

For this I have to download ffmpeg locally. Is there any way to convert oga file to wave directly.

This is how i am saving file

f = open('./file.oga', 'wb')
f.write(base64.b64decode(file))
f.close()

Viewing all articles
Browse latest Browse all 118036

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>