0

I'm trying to play some music during the intro of a game, while using pygame, but the track plays slower than it should play and it sounds like is lagging.

I checked the track parameters with wave module and the output shows this:

_wave_params(nchannels=2, sampwidth=2, framerate=44100, nframes=11278336, comptype='NONE', compname='not compressed')

I tried to play music in this way:

intro_music = pygame.mixer.Sound("music.wav")
pygame.mixer.Sound.play(intro_music)

Originally, I converted the track from a .mp3 format to a .wav format, if it helps.

  • How do you initialize the mixer? – Ted Klein Bergman Sep 19 '20 at 13:41
  • 1
    I initialize it by using pygame.mixer.init(). I read that the default parameters, in this way, are frequency=44100, size=-16, channels=2, buffer=512. However, I also tried to set them using pygame.mixer.pre_init() but the results were the same – ddavide Sep 19 '20 at 14:19

0 Answers0