You are not logged in.

#1 2014-11-23 12:21:30

grishnan
Member
Registered: 2012-10-12
Posts: 7

Python/Pygame dont work sound

Dont work sounds and music in the library Pygame. The Pygame and Python dont show any messages or errors. I tried to use python2-pygame (for Python 2) and python-pygame-hg (Python 3) from AUR. All work fine besides of sounds and music. Has anyone had this problem?

Offline

#2 2014-11-23 12:40:59

TheSaint
Member
From: my computer
Registered: 2007-08-19
Posts: 1,532

Re: Python/Pygame dont work sound

Have you started' em  from the console and see what output giving?


do it good first, it will be faster than do it twice the saint wink

Offline

#3 2014-11-23 12:44:55

grishnan
Member
Registered: 2012-10-12
Posts: 7

Re: Python/Pygame dont work sound

nothing

Offline

#4 2014-11-23 12:50:11

grishnan
Member
Registered: 2012-10-12
Posts: 7

Re: Python/Pygame dont work sound

My soundcard works fine. I can listen music. I tried to change arguments from pygame.mixer.pre_init() and init(). I tried different formats - ogg, wav. I tried run programs with Python2 and Python3. Programs work beautiful but there are no music and sounds.

Offline

#5 2014-11-23 14:06:52

drcouzelis
Member
From: Connecticut, USA
Registered: 2009-11-09
Posts: 4,092
Website

Re: Python/Pygame dont work sound

What program are you trying to run? Is it your own code? Please post the code.

If you just want to test sound in Pygame, install the package "pathological" and run the game ("pathological"). You should hear sound as soon as the main menu appears. You can also look at the source code and audio files from pathological to see how it works.

Offline

#6 2014-11-23 20:15:02

grishnan
Member
Registered: 2012-10-12
Posts: 7

Re: Python/Pygame dont work sound

thank you drcouzelis! But i has localized problem. I run my code in Debian Wheezy and it works beatiful. Unfortunately it dont work in Archlinux. Probably some related packet has bug in Archlinux. Maybe these are sdl_mixer, sdl_sound. I upgraded sdl and related libraries but it didnt help me.

P.S: In pathological sound dont work too.

Offline

#7 2014-11-23 20:29:16

grishnan
Member
Registered: 2012-10-12
Posts: 7

Re: Python/Pygame dont work sound

I had assumption the problem is localized in sdl_mixer. Because python2-pygame and python-pygame-hg depend on sdl_mixer. Probably its wrong thought. I will create bug report for python2-pygame

Last edited by grishnan (2014-11-23 21:51:52)

Offline

#8 2014-11-23 22:25:35

drcouzelis
Member
From: Connecticut, USA
Registered: 2009-11-09
Posts: 4,092
Website

Re: Python/Pygame dont work sound

What version of Python are you using?

The default version of Python in Debian is Python 2.

The default version of Python in Arch Linux is Python 3.

...although this wouldn't explain why sound didn't work in pathological. What sound server are you using? Are you using ALSA? OSS? PulseAudio?

Are there any messages or output at the command line when you start pathological?

Last edited by drcouzelis (2014-11-23 22:26:16)

Offline

Board footer

Powered by FluxBB