Page 1 of 1

Sound volume question

Posted: 26 Aug 2006, 18:24
by Optimus Prime
I asked it some time ago, but no one could help me, so i will try it again.
How is sound volume and sound distance defined?
Sometimes, sounds are very loud and you can hear them everywhere on a small map, sometimes, they are very loud, but only when you zoom near the sound source and sometimes sounds have only low volume.
What i could find out myself is, that the default damage effects the sound volume. I thought that the areaofeffect would define the sound distance, but that seems to be wrong (Annihilator for example can be heard from far away, but it doesnt have a big areaofeffect).
So does anyone know more about the sounds? Do the sound file types have to do with it?

Posted: 27 Aug 2006, 04:32
by Argh
I don't know, either. I've been trying to figure out how sound works for quite a while now, with much frustration- I can get sounds to play, but very frequently sounds that I want to play loud enough to hear over long distances, like big explosions, will play so quietly that they're drowned out by gunfire, etc. It's very annoying!

Posted: 27 Aug 2006, 04:47
by Peet
Try looking in to using openAL libraries.

Posted: 27 Aug 2006, 04:49
by AF
Direct X is used on windows

Posted: 27 Aug 2006, 04:53
by Argh
Again, on point... it's not that sounds don't play... it's that they play TOO QUIETLY.

Posted: 27 Aug 2006, 04:59
by Argh
... just got done with an extensive test. I've found that this has ZERO to do with the sound format. If Spring will play it, it will play it. However, it doesn't mean it'll play it RIGHT. Very annoying!

Posted: 27 Aug 2006, 05:06
by Peet
AF wrote:Direct X is used on windows
Hmm, the funny thing is, spring is opengl...not directx.



Seems to me openAL is quite good for positionally-accurate audio.

Posted: 27 Aug 2006, 05:10
by Argh
Quit derailing the thread, please. This is not about the relative merits of DirectSound via SDL vs. OpenAL.

This thread is about why sounds aren't playing at proper volumes. And why it's not consistant. Some sounds seem to be fine, some aren't... and their relative top-end volumes don't differ by much, if at all. It just doesn't make any sense.

Posted: 27 Aug 2006, 05:23
by Argh
Ok, for unit explosions, I have solved it. Just use play-sound, and compile in TA:K mode. Which is probably what everybody will want to do, once I release the new GPL includes.

Posted: 27 Aug 2006, 05:51
by Optimus Prime
how does the play sound script works? Can you write a complete example please? I tried it and it crashed the game. I selected TAK in scriptor. Do i have to include something important?

Posted: 27 Aug 2006, 05:52
by AF
for the record OpenGL doesnt do sound, thats OpenAL.

Posted: 27 Aug 2006, 06:41
by Argh
Optimus:

Yes, you must use modified Includes when you compile. I will be making all of my code for NanoBlobs, which contains a number of important new advances, available to all modders under the GPL as soon as the mod's sounds and new graphics for the interace are prepared. I'd say... about 72 hours, max, I am making very steady progress, now that the hardest issues have been resolved. Have you read my new Plant script, which I posted in the NanoBlobs thread? If not, go read it... it's just a sample of how much I am going to simplify everybody's lives ;)

The scripting itself is simple:

Code: Select all

play-sound("Argh_SRook_Death",15);
... somewhere in the Killed() script, for example, does the trick.