Re: [AD] Sound API

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


Ben Davis wrote:
It looks to me as if set_volume_per_voice() isn't working properly with the new mixer. The first three should be at different levels, like the last three, shouldn't they?

The first two, maybe. I still don't think the default action should be to accomodate each allocated voice because they *may* all play at the same time and they *may* all be full volume, and the sample *may* end up out of range after all the mixing's done. IMHO, if the user notices and/or is bothered by the clipping, he should just decrease the game's output volume (either via allegro.cfg, the game's own config file, or whatever). The thing I don't like about set_volume_per_voice is that it takes away that control from the user. I don't care if my output clips some. My speakers are crap so I like having/need the volume a little louder than normal, and I don't notice the clipping.

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?

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)

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.

I'm afraid I don't agree with this. Clipping may not be as bad as wrapping but it is still distortion, and the amount you're doing it WILL be noticeable in some situations (e.g. with DIGMID). Clipping often makes me worry that my speakers are too loud and might be damaged - it's that kind of sound. Don't take it lightly.

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.

I'd like to see Allegro's mixer outputting exactly the same volume level as before, in all circumstances. That means:

- In Elias's test, the first three should look the same as the last three;
- EVERYTHING that set_volume_per_voice() describes should remain true.

Can you do this?

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.

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.

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.

set_volume_per_voice() actually gives the choice to the game developer, while keeping set_volume() for the game player. I still believe this choice, as distinct from set_volume(), should be there. (Note that a default volume as set by set_volume() will be read from the config file as well.)

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" (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.

- Kitty Cat




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