Re: [AD] Sound API

[ Thread Index | Date Index | More lists.liballeg.org/allegro-developers Archives ]


On Monday 17 May 2004 14:16, Chris wrote:
> > What about for DUMB's example players? They want to use a single audio
> > stream, stereo panned and centred, and have the output at maximum.
> > set_volume_per_voice(0) is required here.
>
> It's an example player, meant as an example. As I said, how often is
> set_volume_per_voice(0) useful for games?

Whenever I want a single stream, centre-panned, to be able to reach the 
maximum.

> > Remember the rule: if some
> > functionality exists, then people are using it and you must keep it.
>
> There's plenty of arguments that Allegro already doesn't follow this
> (*cough*DX mixer*cough*), but this might be the only thing to convince
> me that it's a good idea to keep it (not that I wouldn't if you wanted
> anyway, mind you; in fact I had already added it back in before I saw
> this email :P)

My argument was that the DX mixer should be kept for a while for emergencies 
and should no longer be the default. I know full well that it ignores svpv 
and so on. As soon as we're sure that the Allegro mixer (and its interface to 
the hardware) works well for everyone on Windows, the DX mixer can go.

Another point is that the Allegro mixer's volume behaviour is well documented 
and the DX mixer's isn't. The latter might not even be the same on different 
computers.

> > From your other e-mail it sounds to me as if you're willing to have a
> > game clip as much as it likes just because it's not going to wrap when it
> > does so.
>
> Right, because the wrapping is much more noticeable than simple
> clipping. And if the clipping is bothersome, the user can simply lower
> the volume.

Most users will naturally reach for the volume control on their speakers, 
which obviously won't solve the problem. The game developer has to take some 
responsibility; if someone sets a ridiculously high value with 
set_volume_per_voice(), that's their fault. We can't be removing a much used, 
and very useful IMO, feature just to try to save the game developer a bit of 
responsibility.

> Nothing's preventing a program from implementing a default volume that
> the programmer safely feels accomodates the voices. I feel that's a
> better method than relying on the max voice count to limit voice volume.

But we're not relying on the max voice count; that's only the default. If it's 
set, we're relying on the parameter to set_volume_per_voice().

> I can, yes, but except for the default setting for set_volume_per_voice
> I can't say I agree with it. And if memory serves, even Bob agreed (on
> IRC) that he'd like the default set_volume_per_voice raised now that
> warpping isn't an issue.

Would I be right in assuming you mean "as for" rather than "except for"?

> > In the long-distant past, Allegro always made samples quite quiet (a
> > centred sample would be one quarter of the maximum volume), and made them
> > even quieter if you requested more voices. This was someone's decision,
> > and would be appropriate sometimes, but is too quiet for a lot of cases.
>
> Which is exactly my point to raise the default. It's too quiet most of
> the time and makes people think the Allegro mixer is inferior because of
> it. I can't pretend to know Shawn's true intention for limiting the
> voice volume by default, but if I had to guess I would say it's because
> the possiblity wrapping was too great, which is no longer true (let
> alone possible) with my patch.

So how about a compromise: raise the default but make sure any program that 
calls set_volume_per_voice() will behave the same as before?

> > I hacked my own version of Allegro to play everything louder, and I think
> > you did the same at one point, didn't you, Chris? But this was again a
> > personal decision that was appropriate for my games and wouldn't be
> > appropriate for everyone's.
>
> Right, but with set_volume_per_voice, we don't even have that choice
> without changing the program in question.

I don't know what you did, but I, as a _game developer_ (not an end-user), 
hacked Allegro for the purposes of building binaries for a couple of my 
games. set_volume_per_voice() meant I no longer had to do this.

If you download my game and you want it to be louder, you should turn your 
system volume control or the knob on your speakers up. If you can't do this, 
you're going to have trouble with Winamp/XMMS and every other 
sound-generating program out there; I don't think Allegro should be catering 
to a problem like that.

> I don't agree. I don't see any reason for the programmer to be able to
> say "you can't go above this volume level because I think it's bad"

I don't see why we're asking for Allegro programs to be able to go so much 
louder than all the other programs out there. With set_volume_per_voice(), 
Allegro games will all generate roughly the same overall output level (unless 
the game developer is an idiot), and it will be the same output level as all 
the other programs on the system.

If set_volume_per_voice() is wrong because it takes a choice away from the 
user, should we also remove GFX_AUTODETECT_FULLSCREEN and 
GFX_AUTODETECT_WINDOWED from Allegro?

> (this isn't even touching the fact that the library currently sets an
> extremely low volume level by default because it feels it's bad to go
> over it, and that the programmer has to actively add extra code, though
> granted only one line, to override this). If the program has a risk of
> distortion, the programmer can set the default volume to something he
> deems reasonable, but the user should be able to go above this if he so
> chooses. I don't see any reason not to do it that way.

Apart from backwards compatibility and the fact that the volume level only has 
8-bit precision.

Ben




Mail converted by MHonArc 2.6.19+ http://listengine.tuxfamily.org/