UFO:Alien Invasion

Development => Sounds and Music => Topic started by: Mattn on April 09, 2009, 07:52:57 am

Title: Normalizing sounds
Post by: Mattn on April 09, 2009, 07:52:57 am
Hi,

it would be very nice if someone with a decent equipment (i only have stereo headsets where the right side is defect ;)) and a ear for stuff like that would normalize the shooting and footstep sounds - the footstep sounds are a little bit too loud in relation to the shooting sounds imo (at least on my defect headset). the shootgun sounds not really like a shootgun - could be a little bit louder imo. if there are weapons that are using the same sounds where one should be louder but the other not, we should just add a new file.

edit
Please also try to convert them into the ogg format while you are on it.
Title: Re: Normalizing sounds
Post by: Destructavator on April 12, 2009, 02:08:03 am
I can take care of this one - it falls right into my expertise.

The only part I'd need a little help with is what a real shotgun should sound like - the one in the game that is - as I can look up clips and videos of shotguns in action on the net, but I don't know what models or types are closest to the one in the game.

If someone who knows firearms well and is familiar with what the shotguns in the game are based upon, and can perhaps list or point to a few comparable real-life models that there are clips of on the net (that would sound like what is desired, of course), that would be a big help.

Another thing I can do is take the existing sounds that have GPL licenses and base new sounds upon them to replace the ones without a license of any kind, that way they can all eventually have a license.
Title: Re: Normalizing sounds
Post by: Destructavator on April 12, 2009, 03:09:35 am
Quote
Another thing I can do is take the existing sounds that have GPL licenses and base new sounds upon them to replace the ones without a license of any kind, that way they can all eventually have a license.

Here's a quick-and-dirty example of a few variants of the assault rifle sound, modified in a few different ways.  I suppose these could be used for different weapons or something, although I'm not an expert in firearms.

[attachment deleted by admin]
Title: Re: Normalizing sounds
Post by: Hertzila on April 12, 2009, 10:40:50 am
At least from the way the shotgun looks like, here is a couple of shotguns that look similiar and likely would sound similiar: Saiga line, USAS-12, SPAS-15. Though I don't know if they have clips in the net and it's possible that the magazine doesn't affect the sound in any way, in which case any semi-auto-shotgun (Benelli perhaps) would do the trick.
Did I understand correctly what you needed?
Edit: For the Micro-shotgun, I'd guess any short-barreled shotgun or sawn-off shotgun is good enough.
Title: Re: Normalizing sounds
Post by: Destructavator on April 12, 2009, 07:54:18 pm
Quote
Did I understand correctly what you needed?

Yes, perfectly, thank you very much - this certainly helps quite a bit.  Quite honestly I've never heard of most of these weapons you've just mentioned, but thankfully in this Internet age we do have search engines and such.  I'll look these models up at some point when I have time, I'd imagine that at least some of them should have audio or video clips I could find.
Title: Re: Normalizing sounds
Post by: Mattn on April 13, 2009, 12:35:38 pm
... but keep the licensing stuff in the back of your head while searching for them ;)
Title: Re: Normalizing sounds
Post by: Mattn on April 28, 2009, 09:39:19 pm
any progress on this front?
Title: Re: Normalizing sounds
Post by: Destructavator on April 28, 2009, 10:49:04 pm
Actually yes, I've been grabbing video clips off the net of real firearms in action, and what I'm going to do is try to manipulate the existing GPL sounds in various ways - I know from research that most weapons sounds in games as well as many movies are actually synthesized or sounds from other things that are manipulated, as taking samples from recordings of real guns often leads to poor results (as well as running into license/copyright issues).  I've also found articles on the net that describe various ways of editing sounds in such ways, and as I said I have plenty of tools to do this.

I also wanted to ask - should the resulting sounds be "dry" (no reverb or ambiance), or should they have some kind of room/spatial effect?  Can the SDL playback in the game add such reverb effect easily?  Dry shooting sounds really do sound very different than ones with reverb.
Title: Re: Normalizing sounds
Post by: Destructavator on April 29, 2009, 02:48:29 am
Update: Here's my very first original, home-brewed gunshot/impact sound that I made on my own, not from other samples, but from inflating a plastic bag in my apartment, popping it in front of a Heil PR-20 XLR microphone, and manipulating it with software.

This one's dry, no reverb, and is just a basic one that isn't aimed at imitating any specific weapon.

Please tell me what you think - If you like it I'll let it go around under GPL license, if that will work.  I can also further manipulate it to make similar sounds.

I glanced at the footstep sounds, I think the weapon sounds should be done first as the footsteps are supposed to be quieter, unless you devs want the footsteps normalized at full volume and just end up playing them softer in the game (via coding).

[attachment deleted by admin]
Title: Re: Normalizing sounds
Post by: Destructavator on April 29, 2009, 04:09:30 am
Here's what that sample would sound like in action, fired in bursts, with a quick-and-dirty reverb.  I don't know guns too well - does this sound close to a firearm?

[attachment deleted by admin]
Title: Re: Normalizing sounds
Post by: Mattn on April 29, 2009, 07:39:45 am
I also wanted to ask - should the resulting sounds be "dry" (no reverb or ambiance), or should they have some kind of room/spatial effect?  Can the SDL playback in the game add such reverb effect easily?  Dry shooting sounds really do sound very different than ones with reverb.

we have spatialization support in our sound backend. imo there should be no such reverb or ambience added to the sound. if we ever decide to add such effects, this should be done codewise. but i'm a n00b in sound questions, so if there is a good reason to add them to the sound files, please let me know. i totally trust your experience here.
Title: Re: Normalizing sounds
Post by: Mattn on April 29, 2009, 07:41:28 am
I glanced at the footstep sounds, I think the weapon sounds should be done first as the footsteps are supposed to be quieter, unless you devs want the footsteps normalized at full volume and just end up playing them softer in the game (via coding).

they should already be quieter as the weapon sounds, that's right
Title: Re: Normalizing sounds
Post by: Mattn on April 29, 2009, 07:46:57 am
now after I've tried your example files, i would say we definitely need reverb but no ambience. i will have a look at the SDL_mixer effects.

that autoburst thing sounds nice imo (i didn't had enough imagination for the single shot version ;) )

btw. also the assault sound from above (the none ambient alpha version) sounds nice to me.

but keep in mind that I'm only owning and old and defect headset, so I might not be the person to really judge this
Title: Re: Normalizing sounds
Post by: Destructavator on April 29, 2009, 08:06:25 am
Quote
that autoburst thing sounds nice imo (i didn't had enough imagination for the single shot version Wink )

Yeah, I like the way auto-burst example came out too, it had a little reverb and spatial stuff mixed in, and it shows that those types of effects make a big difference with gunshots and explosions.

The single shot is the "dry" one, meaning no effects were added.

Quote
btw. also the assault sound from above (the none ambient alpha version) sounds nice to me.

That was an edited version of the existing assault rifle sound, one of the ones which does have a (GPL) license, If memory serves I think that's one of the ones made by someone named Alex Parker or something, I'd have to double-check the SVN and license info.

Quote
now after I've tried your example files, i would say we definitely need reverb but no ambience. i will have a look at the SDL_mixer effects.

OK, if you have any audio questions, just ask - I don't know what SDL offers for such effects, but I do know the difference between things like "low cut," "damping," and "early reflections," etc. and I can help explain how much of what should be added to get a decent sound.  (If you come across a list of such features for SDL, it might be good to copy and paste into this thread such a list so I have some idea of what there is to work with.)

Quote
but keep in mind that I'm only owning and old and defect headset, so I might not be the person to really judge this

Who do we have here (who is currently active in the project) who is in charge of something like this and would be a good judge?

It's too bad we live so far away from each other - I've got lots of extra headsets, speakers, and audio stuff, but getting it shipped to where you are might be difficult (mostly expensive)...

Quote
we have spatialization support in our sound backend. imo there should be no such reverb or ambience added to the sound. if we ever decide to add such effects, this should be done codewise. but i'm a n00b in sound questions, so if there is a good reason to add them to the sound files, please let me know. i totally trust your experience here.

I agree - the sound files the game reads from the pk3s should be "dry" without any effects added before hand, they should be added in the game with the SDL code if possible.
Title: Re: Normalizing sounds
Post by: Hertzila on April 29, 2009, 04:08:31 pm
That plastic gunshot sounds like a shot from a subsonic weapon or a shot from afar (frankly it reminds me of airsoft gas gun). Burst version sounds nice for a weapon like that. I might not be the best judge, but it seems pretty good for a light weapon. Though it might be a little too "unexplosive" in a way that it sounds like a electric gun or gas powered gun (effects might correct this).
For supersonic weaponry (nearly everything two-handed), IMO it doesn't have (enough) sonic boom and/or explosion mixed in. I know we don't want to make people deaf but it isn't simply loud enough.
Title: Re: Normalizing sounds
Post by: Destructavator on April 29, 2009, 04:53:05 pm
Thanks, this is good feedback.  Perhaps it could be used as a new sound for light weapons then?

I manipulated it further, and got another sound which I'm attaching - one dry, another with some reverb and as an automatic fire demo.  I don't know how it compares with the first (I'll need feedback again), although if new sounds are needed for the big guns, I may have to record a new sample to edit.

[attachment deleted by admin]
Title: Re: Normalizing sounds
Post by: Hertzila on April 29, 2009, 06:32:14 pm
Perhaps. It does sound like one very well enough IMO.
The new sound doesn't sound like a gunshot but I can imagine it being a laser weapon. The high speed version sounds especially like pulse shooting or the suggested UGV tri-laser shooting in pulse mode (9 lasers). Other possibility is a particle beam, though I think it is better for a laser weapon.
Edit: If we are ever going to use silenced weaponry, this sound is also a good candidate for that.
Title: Re: Normalizing sounds
Post by: Mattn on April 29, 2009, 07:23:20 pm
looks like it is not really possible in a nice way to add a reverb effect via sdl_mixer... i'll dig a little bit more but maybe you have to add them to the soundfiles (just that you are warned ;) )
Title: Re: Normalizing sounds
Post by: Destructavator on April 30, 2009, 12:28:03 am
Perhaps. It does sound like one very well enough IMO.
The new sound doesn't sound like a gunshot but I can imagine it being a laser weapon. The high speed version sounds especially like pulse shooting or the suggested UGV tri-laser shooting in pulse mode (9 lasers). Other possibility is a particle beam, though I think it is better for a laser weapon.
Edit: If we are ever going to use silenced weaponry, this sound is also a good candidate for that.

OK, that's actually a good thing considering many of the weapons in the game don't use bullets and I suppose it wouldn't hurt to have more energy weapon sounds.

looks like it is not really possible in a nice way to add a reverb effect via sdl_mixer... i'll dig a little bit more but maybe you have to add them to the soundfiles (just that you are warned ;) )

OK, I can easily add a little reverb on the samples, no problem there, but I'm guessing that without the SDL_Mixer controlling how much reverb and how it sounds, all the weapon sounds will end up sounding the same regardless of if they are indoors or outdoors.

I could, however, as a solution easily make two versions of each weapon sound, one for firing outside and another for indoors for realism.  I know there is already code in place for footsteps on different materials the actors stand on - if you want more realistic sound FX perhaps the materials could be grouped into "indoor" and "outside" - when a soldier/unit is standing on an indoor material and fires a shot the indoor firing sound would play, etc.

On the other hand, if you don't want to code all that I can just make a generic, subtle reverb effect on all the weapon sounds without any special extra ambiance or anything.
Title: Re: Normalizing sounds
Post by: Destructavator on May 02, 2009, 12:57:28 am
Update:  I did some work on the footsteps, got them normalized and all in the same format, then packaged them up in a ZIP file.  There's just one problem now:  My website hosting service is having issues as it won't talk to Filezilla, regardless of the fact that a few days ago it worked fine with the same settings and nothing has changed on my end.   >:(

Crapwise, the ZIP file is also too big to attach to this post.   :(

As if that wasn't bad enough, I lost where I wrote down the password to my FileFront upload account, and I'm having difficulty recovering it.   :P

As soon as I find a good alternate way of getting it in the hands of Mattn and the other devs, I'll post an update.

Title: Re: Normalizing sounds
Post by: BTAxis on May 02, 2009, 01:27:56 am
You could email it.
Title: Re: Normalizing sounds
Post by: Mattn on May 07, 2009, 10:19:27 pm
Hi Destructavator,

any news for us?  :)
Title: Re: Normalizing sounds
Post by: BTAxis on May 07, 2009, 11:56:21 pm
He sent us both a PM. Didn't you read it?
Title: Re: Normalizing sounds
Post by: Destructavator on May 08, 2009, 04:24:36 am
He sent us both a PM. Didn't you read it?

Actually I believe he did, and then he asked me to try to do some more work on the footsteps, specifically changing the length of the samples and making them OGG instead of WAV.  Sorry if you got left out of the loop for a moment BTAxis, I forgot to post something back in this thread for you and everyone else.

Regarding the samples,

Hi Destructavator,

any news for us?  :)

...I didn't forget about the footsteps and weapon sounds, I have been rather busy with little spare time lately (I haven't had much time trying to get the game to compile with the new libraries and such since my post in the other thread), but I have tomorrow (Friday) off, I'm almost done with the footsteps, and I should have the footsteps ready tonight or tomorrow.  As for the weapon sounds, I'm still working with them, and for now if you want to add any of the "plastic" gunshot sounds I made to the trunk or data source you are welcome to go ahead and do so (GPL license is fine, if that will work, I think some of the other weapons sounds are in some type of GPL license.)

I actually planned in the last few days to record some new footsteps myself, although it turns out I didn't have time, at least until now, but I'll first get to fixing the existing ones.
Title: Re: Normalizing sounds
Post by: Destructavator on May 08, 2009, 05:05:23 am
http://destructavator.com/92dl/footsteps.zip

OK, here they are, OGG, 44.1Khz, stereo, VBR encoding, all the same length.
Title: Re: Normalizing sounds
Post by: Mattn on May 08, 2009, 06:55:08 am
thank you very much
Title: Re: Normalizing sounds
Post by: Mattn on May 17, 2009, 09:37:12 am
i've finally bought new sounds equipment and noticed that the footstep sounds are still a little bit too loud. i've removed 5db from flesh1.ogg and this came a little closer. what do you think? can (and should) we reduce the volume again?

if yes - how can one do that in a batch? i would like to be able to normalize them all against each other. the best way would be something like mp3gain or vorbisgain (not sure whether they would do the job - but we could use them in a script) to be scriptable, no?
Title: Re: Normalizing sounds
Post by: Destructavator on May 17, 2009, 04:26:39 pm
i've finally bought new sounds equipment and noticed that the footstep sounds are still a little bit too loud. i've removed 5db from flesh1.ogg and this came a little closer. what do you think? can (and should) we reduce the volume again?

if yes - how can one do that in a batch? i would like to be able to normalize them all against each other. the best way would be something like mp3gain or vorbisgain (not sure whether they would do the job - but we could use them in a script) to be scriptable, no?

OK, first off, to balance the sounds - meaning to have all the sounds play at the right volume in relationship to each other in the game, such as gunshots being louder than footsteps, and death screams somewhere in-between for example, there are two basic methods to get that end-result, although one is better than the other:

1) Have all the *source* sound files balanced so that the C code plays all the sounds through SDL at a volume simply multiplied by a variable for how loud all sound effects are, which is set by the player in the game settings menu.

Or,

2) Have all the sounds normalized at max volume, and during gameplay the game determines the volume to play the sounds via SDL by multiplying *two* variables, one of which is the SFX volume the player sets, another being a hard-coded constant set in the C code for that group of sounds.  So if, for example, the player goes to the options menu, sets SFX volume at 80%, and plays a battle mission, and the footsteps are supposed to be half as loud as gunshots, footsteps sounds are played in the game at 0.80*0.5=40% volume, while gunshots are played at 0.80*1.0=80% volume.  (The middle number is the hard-coded multiplier.)

I would recommend the second option, because in the second case if gameplay testing shows that something is not balanced right, it would be very easy to tweak the code, simply changing the hard-coded variable that multiplies the volume for that group of sounds.  The trial-and-error for balancing all the sounds would take much less time, just changing one value of one line in the C source code.

Yes, there are ways to process the sounds in batch to globally change the volume of each group, the open-source and cross-platform app Audacity can do this, but I would strongly recommend the second of those two options I listed above.

If, on the other hand, the issue is that volume needs to be adjusted within the group (if some footsteps should be louder than other footsteps), this is something that would take more work with the source sound files, but I'm willing to do the work and get back to you on it.

Did I understand the question correctly?
Title: Re: Normalizing sounds
Post by: Mattn on May 17, 2009, 06:25:11 pm
yes you understood correctly - i will think about the second solution.

but there are still some sounds that are louder (or have more bass - i don't know) than others. see e.g. the grass.ogg in footsteps compared to wood1.ogg

if you could normalize them all to the same level that would be the best imo (and maybe also convert the wav files to ogg vorbis)

and another question:

Code: [Select]
mattn@mattn-desktop:~/dev/ufoai/trunk/base/sound/footsteps$ file wood1.ogg
wood1.ogg: Ogg data, Vorbis audio, stereo, 44100 Hz, ~499821 bps, created by: Xiph.Org libVorbis I

why do your files have such a strange bps rate compared to others?

Code: [Select]
mattn@mattn-desktop:~/dev/ufoai/trunk/base/sound/ambience$ file sparks_short.ogg
sparks_short.ogg: Ogg data, Vorbis audio, stereo, 44100 Hz, ~160000 bps, created by: Xiph.Org libVorbis I

greetings
martin
Title: Re: Normalizing sounds
Post by: Mattn on May 17, 2009, 07:00:49 pm
ok, it's implemented now - footstep sounds have a relative volume of 0.3, weapons and geoscape currently have 1.0
Title: Re: Normalizing sounds
Post by: Destructavator on May 17, 2009, 07:07:47 pm
For your first request: Yes, I can work on each of the individual footstep sounds so that they are balanced in relationship to each other - After all, stepping on grass or carpet doesn't make as much noise as stepping on something solid.  It will take a little work for me to do this as I'd have to balance every single sample against all the others, but I can get started on it sometime today.

For the second point about bitrate:  The discrepancy probably comes from the fact that I used VBR (Variable Bit Rate) encoding instead of CBR (Constant Bit Rate) encoding to make those OGG files.  (The OGG encoder I have supports CBR, VBR, and ABR encoding).  If you would prefer CBR encoding I can do this quite easily and do it that way instead.

ok, it's implemented now - footstep sounds have a relative volume of 0.3, weapons and geoscape currently have 1.0

As a suggestion, you might want to add a CVAR or console command to adjust relative volumes in-game, for quicker balancing and testing purposes.
Title: Re: Normalizing sounds
Post by: Mattn on May 17, 2009, 08:13:21 pm
For your first request: Yes, I can work on each of the individual footstep sounds so that they are balanced in relationship to each other - After all, stepping on grass or carpet doesn't make as much noise as stepping on something solid.  It will take a little work for me to do this as I'd have to balance every single sample against all the others, but I can get started on it sometime today.

that would be cool.

Quote
For the second point about bitrate:  The discrepancy probably comes from the fact that I used VBR (Variable Bit Rate) encoding instead of CBR (Constant Bit Rate) encoding to make those OGG files.  (The OGG encoder I have supports CBR, VBR, and ABR encoding).  If you would prefer CBR encoding I can do this quite easily and do it that way instead.

i don't prefer anything here - i don't know enough about the difference. so it's up to you.


i will think about the introduction of cvars - if they would all be in the client code i would have done this already - but the footstep sound parsing (which sets some default values, too) is also available for the server to be able to play hidden actor sounds. so a little bit of redesign is needed to do it properly.