I'm creating an app that plays podcasts in PyQt5. It retrieves the MP3 from a URL and plays it using QMediaPlayer. The issue I'm running into is when I wish to play these podcasts back at a faster speed. Using setPlaybackRate(rate) I change the rate between 1, 1.25, 1.5, 1.75, and 2. Anytime the rate is greater than 1, the voices turn into high pitched chipmunk voices.
Are there any ways around this? I was using python-vlc, which worked fine in this regard, but wanted to switch to QMediaPlayer to remove the VLC dependency. I really appreciate any help.
According to Qt Documentation
By default, the Qt prefers the DirectShow instead of windowsmediafoundation. Now let's come to your answer.
The Directshow plugins which was the older plugin changes the pitch when you change the playbackrate
While the newly introduced Windows Media Foundation (WMF) doesn't affect the pitch
So all we have to do is switch from directshow to windowsmediafoundaton
Just add the below code at the top of your Code before importing anything else
This might do the work, if the audio is not audible after adding this code then all you have to do is download some codecs from here https://codecguide.com/media_foundation_codecs.htm