【发布时间】:2012-03-27 23:47:26
【问题描述】:
我正在使用 Python Wave 库生成波形,并使用自定义文件编写器将它们存储在内存中。但是,每当我尝试使用 Pygame 播放它们时,播放速度都非常慢。如果我将 exact same 对象保存到一个文件中,然后播放它,pygame 会以正常速度播放它。
(某人的缩写)代码:
pygame.init()
pygame.mixer.init(size=8, buffer=2048, frequency=44100) #Thats the correct freq, but it does the same regardless
x = pygame.mixer.Sound(obj) #Load the output of the wave writer
x.play()
有什么想法吗?
【问题讨论】: