1

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.

Simon Mayrshofer
  • 1,264
  • 1
  • 11
  • 18

1 Answers1

0

One way to do this would be to use this Audio Slowdown Software.]1

This would have the advantage of being easily reusable without having to type extra code or extra lines.

Aditya Bhadra
  • 23
  • 1
  • 1
  • 8
  • Your answer could be improved with additional supporting information. Please [edit] to add further details, such as citations or documentation, so that others can confirm that your answer is correct. You can find more information on how to write good answers [in the help center](/help/how-to-answer). – Community Nov 02 '22 at 14:48
  • that's actually not at all want i want to achieve, as i am building a toll with which i want to be able to change the audio to varying speeds during playback – Simon Mayrshofer Nov 03 '22 at 09:05