Re: [pygame] Overall volume control for sounds

2010-11-27 Thread B W
I too spent some time rassling with volume control. The result was an
extension of the conch module (
http://www.pygame.org/wiki/ConchMusicSoundToolkit) to provide
master/music/fx volume control for Trolls Outta Luckland. See gumm_sound.py
in the source package at
http://www.pygame.org/project-Trolls+Outta+Luckland-1358-2536.html.

Gumm

On Sat, Nov 27, 2010 at 12:47 AM, Janosch Gräf wrote:

> Ivan DelSol wrote:
> > I'm trying to write a system that has controls for overall sound
> > effect volume. There does not seem to be a way to control all the
> > sound channels... There doesn't seem to be a way to get pygame to pass
> > channels by ID so that I could alter their volumes individually, let
> > alone control the sound channels' volumes as a whole.
> >
> > Volume control seems like a pretty standard need in a game. Anyone
> > else figured this out?
> >
> >
> Can't you just do it like this?
> for i in range(pygame.get_num_channels()):
>c = pygame.Channel(i)
>c.set_volume(your_volume)
>
>


Re: [pygame] Overall volume control for sounds

2010-11-27 Thread Janosch Gräf
Ivan DelSol wrote:
> I'm trying to write a system that has controls for overall sound
> effect volume. There does not seem to be a way to control all the
> sound channels... There doesn't seem to be a way to get pygame to pass
> channels by ID so that I could alter their volumes individually, let
> alone control the sound channels' volumes as a whole.
>
> Volume control seems like a pretty standard need in a game. Anyone
> else figured this out?
>
>   
Can't you just do it like this?
for i in range(pygame.get_num_channels()):
c = pygame.Channel(i)
c.set_volume(your_volume)