[Author Prev][Author Next][Thread Prev][Thread Next][Author Index][Thread Index]

Re: [pygame] music.queue not working on Raspberry Pi



​​
On Wed, Sep 21, 2016 at 10:25 AM, Ian Mallett <ian@xxxxxxxxxxxxxx> wrote:
​I was able to reproduce this. Additionally, while playing around with this, I found some much simpler issues I'd consider possible bugs (system is Win 7).

1: "pygame.init()" doesn't work; one must call "pygame.mixer.init()". Despite, the documentation saying the global init is sufficient. Example:

import pygame; pygame.init() #this line broken
pygame.mixer.music.load("a.wav"); pygame.mixer.music.play(); input()

import pygame; pygame.mixer.init() #okay
pygame.mixer.music.load("a.wav"); pygame.mixer.music.play(); input()


2: For both ".wav" and ".mp3", the sound is distorted and wrong for "mixer.music". A 0.5s 440 Hz square wave is attached as a test. Compared to the system's playback, PyGame appears to shift the frequency down about 20 Hz and garble it. Example (see above; try also with ".mp3").

3: For ".wav" and "mixer.Sound", the same is true. Example (see above).

4: For ".mp3" and "mixer.Sound", the sound doesn't play at all through mixer.Sound. Example:

import pygame; pygame.mixer.init() #next line broken
snd=pygame.mixer.Sound("a.mp3"); snd.play(); input()


Ian

Attachment: 440.zip
Description: Zip archive