quick question.
I run pygame under linux only to play some audio files. I have some .wav files, and I am having problems playing them at the right speed.
import pygame.mixer, sys, time
#plays too fast
pygame.mixer.init(44100)
pygame.mixer.music.load(sys.argv[1])
pygame.mixer.music.play()
time.sleep(5)
pygame.mixer.quit()
#plays too slow
pygame.mixer.init(22100)
pygame.mixer.music.load(sys.argv[1])
pygame.mixer.music.play()
time.sleep(5)
pygame.mixer.quit()
I was looking for some ggogle code, but everyone seems to perfectly call the init function with default parameters. Can other users run this script and see if they get the same behavior or not? Does anyone know how to speed it up? Or adjust the speed for each file?
Thanks.
source
share