Skip to content Skip to sidebar Skip to footer

Play Mp3 File Not Using Default Output (playback) Device In Python

I know that on PyAudio it is possible to choose on what playback device to stream on but PyAudio doesnt support mp3 files. My script would work if one of the following problem was

Solution 1:

First of all, The link you mentioned in your answer is about pymedia and not pydub.

Next, I've converted many files from mp3 to wav using pydub without issues.

If you want to give it a try, here is an one liner code to covnert from mp3 to wav. You will be able to use rest of your code this way using option-2.

from pydub import AudioSegment
AudioSegment.from_file("audio.mp3", format="mp3").export("audio.wav", format="wav")

Post a Comment for "Play Mp3 File Not Using Default Output (playback) Device In Python"