[Author Prev][Author Next][Thread Prev][Thread Next][Author Index][Thread Index]
Re: [pygame] pygame.mixer on windoes
On Tue, Apr 25, 2006 at 04:58:38AM -0700, Ari Krupnik wrote:
> I'm trying to play a wav through pygame. It works on Linux, but on
> Windows I get no sound. The same file plays correctly though WinAmp
> and MS Media player on the Windows machine. I followed the suggestion
> at http://www.pygame.org/docs/ref/mixer.html and tried specifying a
> larger buffer in pygame.mixer.pre_init, but that had no effect. I
> haven't used Windows in a few years. Is there something obvious I
> should be checking for?
>
> The wav is 8kpbs, unsigned 8-bit, mono stream created with the Python
> wave module. Both Linux and Windows show the same output in
> interactive shell, but on Windows there is no sound:
>
> >>> import pygame
> >>> from pygame.locals import *
> >>> pygame.init()
> open /dev/sequencer: No such file or directory
> (6, 0)
You need to create a window:
>>> screen = pygame.display.set_mode((640, 480))
It's a Windows thing ...
cheers,
John Popplewell.
> >>> s=pygame.mixer.Sound("/home/ari/aa.wav")
> >>> s.play
> <built-in method play of pygame.mixer.Sound object at 0xb7d770f0>
> >>> s.play()
> <Channel object at 0xb7d770e0>
> >>>
>