pygame.mixer.music; music crackles when playing ogg files -
i can music play when loops, if it's .ogg file there's noticeable crackle noise. crackling or clicking noise doesn't occur when .mp3 or .wav looped, .ogg files.
if convert .ogg file .mp3 using audacity, there's no crackle noise when loops. i've tried looking answers nothing i've found works.
import pygame, sys, pygame.mixer pygame.locals import * white = (255, 255, 255) pygame.mixer.pre_init(44100, -16, 2, 2048) pygame.init() displaysurf = pygame.display.set_mode((300,400)) pygame.mixer.music.load('data/acrostics.ogg') pygame.mixer.music.play(-1) while true: displaysurf.fill(white) event in pygame.event.get(): if event.type == quit: pygame.quit() sys.exit() pygame.display.update()
before pygame.init()
try pygame.mixer.pre_init(44100, -16, 2, 1024)
or can instead try : pygame.mixer.pre_init(44100, -16, 2, 4096)
Comments
Post a Comment