Re: [pygame] Noob question: playing sounds

2015-06-01 Thread B W
Hi, you cannot use the dummy video driver if you want sound. At least I
have not figured out a way to do it. You need at least a 1x1 window.

Gumm

On Mon, Jun 1, 2015 at 2:11 PM, Philip Le Riche 
wrote:

>  Just trying to get started with pygame and stuck at square 1. All I want
> to do is play sounds on a Raspberry Pi (Raspbian). No screen. Nothing
> visual. So I do:
>
> import pygame, os, sys
> from pygame.locals import *
>
> os.environ["SDL_VIDEODRIVER"] = "dummy"
>
> pygame.mixer.init()
> sound = pygame.mixer.Sound("Exclamation.wav")
> sound.play(loops = 0)
> while pygame.mixer.music.get_busy() == True:
> continue
>
> Having saved it in file try.py, I do
>
> python try.py
>
> and get
>
> xcb_connection_has_error() returned true
>
> Yes, I've done an apt-get update and upgrade. I can make sounds with Sonic
> Pi but this produces nothing. Googling the error seemed to give no relevant
> results. Can someone give me a hint please?
>
> Regards - Philip
>


[pygame] Noob question: playing sounds

2015-06-01 Thread Philip Le Riche
Just trying to get started with pygame and stuck at square 1. All I want
to do is play sounds on a Raspberry Pi (Raspbian). No screen. Nothing
visual. So I do:

import pygame, os, sys
from pygame.locals import *

os.environ["SDL_VIDEODRIVER"] = "dummy"

pygame.mixer.init()
sound = pygame.mixer.Sound("Exclamation.wav")
sound.play(loops = 0)
while pygame.mixer.music.get_busy() == True:
continue

Having saved it in file try.py, I do

python try.py

and get

xcb_connection_has_error() returned true

Yes, I've done an apt-get update and upgrade. I can make sounds with
Sonic Pi but this produces nothing. Googling the error seemed to give no
relevant results. Can someone give me a hint please?

Regards - Philip