I want to playback an .mp3 file at 50% it's original speed, naturally pitched down (i.e. keeping the pitch is not my requirement).
I am using pygame.mixer
and found several solutions (such as this one) that suggest changing the frequency on initialization should do the job as shown below, however that does not work for me.
from pygame import mixer
mixer.init(frequency=22050) # my track.mp3 has a 44100 sample rate
mixer.music.load("track.mp3")
mixer.music.play()
Am I doing something wrong? No matter to what value i change frequency
it does not at all change the playback speed or pitch of the music played.
I found this solution here, with which I am able to speed down my track and play it back using mixer.Sound(speed_change(sound, 0.5).raw_data()).play()
, however this method does not allow me to use the mixer.music
functionality such as seek(time)
or setting the start time when using .play()
.
I am generally also open to solutions that are not using pygame mixer, however I do need to be able to stop and/or pause the playback and have a seek functionality.