Page 4 of 5

Re: Sound effects

Posted: Sun Dec 06, 2015 11:36 pm
by Norby
pagroove wrote:
fade out at the end.
I already tried with a total flat sound file but the clicks remain in this case also so a fade out can not help.
pagroove wrote:
combines the extra sounds by Fritz and the system by Norby as I don't like that the chatter and the in-station ambient sounds are now disabled.
The ambientSounds setting of BGS is enabled at me due to no problem if play the original sound together with the changed ones. So simply enable it in the FG version in the 109. line in engine_sound_fg.js.

Re: Sound effects

Posted: Sun Dec 06, 2015 11:59 pm
by pagroove
I already tried with a total flat sound file but the clicks remain in this case also so a fade out can not help.
Ok. well IMO it is not so bad. It adds to the charm that you hear a kind of broken pitch up or down sound.

Re: Sound effects

Posted: Mon Dec 07, 2015 12:12 am
by Fritz
Fading won't help, even if it is unnoticed when looping. That's because we stop the sound an a random position for starting the next one. The crackling can occur at starting and ending. We can always start at the right position (when using play() instead of volume change), but we can't always stop at a "zero crossing point", as it is called in Audacity.

And yes, you can probably play BGS and Engine Sound FG together, because turning off the accelerating and decelerating sounds in BGS is a separate switch (I didn't find out yet what else this switch turns off). Leaving the ambient engine sound would just add an additional background noise, but you should keep in mind that the BGS noise is identical to the "high speed" noise in Engine Sound (FG), so that probably would sound strange. I never tried it, because I would have turned of the chatter anyhow... it's sounding very realistic, but it was driving me crazy!

I'll make a test and add a BGS-off switch in the config section for the next version. Probably I'll read the BGS chatter and crowd noise switches, and if they are set to false, I can turn off the engine noise in any case.

Re: Sound effects

Posted: Mon Dec 07, 2015 12:29 am
by Fritz
The combination is a little bit louder of course but doesn't sound too bad - much better than I had imagined. It's probably a good idea to increase the maneuvering volume in this case, but it is not really necessary.

Btw, I had to leave the chatter zone to hear the difference! :lol:

Re: Sound effects

Posted: Mon Dec 07, 2015 4:13 pm
by Svengali
Just a quick note. If I recall it right SDL provides max. 32 audio channels...

Re: Sound effects

Posted: Mon Dec 07, 2015 5:20 pm
by another_commander
Svengali wrote:
Just a quick note. If I recall it right SDL provides max. 32 audio channels...
Yes, but we are running sound on OpenAL now.

Re: Sound effects

Posted: Mon Dec 07, 2015 7:33 pm
by Svengali
@a_c: Please explain it a bit more in depth. Does it mean that Oolite creates an 'infinite' number of concurrent playing sources (if OXPs do request them) until the machine runs out of memory, the CPU locks or the sound-driver says no? Is it then a hardware specific max number? Or does a mix-down happening?

Re: Sound effects

Posted: Mon Dec 07, 2015 10:12 pm
by another_commander
On Windows OpenAL (and most likely the other two ports too), we have 256 sound sources by default:255 mono + 1 stereo. In practice we are limited by the hardware though. Some devices provide 32 simultaneous sources, others might be capable of handling more.

This article on stackoverflow.com has some interesting information about this.

Re: Sound effects

Posted: Tue Dec 08, 2015 10:26 am
by Fritz
That's good to know! The experimentary version with 25 sounds playing simultaneously (most of them with volume 0) didn't solve the crackling problem, so my OXP currently uses a maximum of 3 sounds playing together: engines, maneuvering and torus. Then we have the core game sounds: espeak voice, lasers, beeping, incoming laser hits, missile launching and perhaps some other sounds, probably less than 10. So if I add generator or cooler sounds, we would be on the safe side even with a limit of 32.

Re: Sound effects

Posted: Tue Dec 08, 2015 2:02 pm
by Svengali
Indeed - a good article. Thanks a_c .-)

Re: Sound effects

Posted: Tue Dec 08, 2015 9:15 pm
by ocz
Does this (Re: [FIXED] Music and Sound stuttering with OpenAL) affect the above mentioned crackle problems?

Re: Sound effects

Posted: Tue Dec 08, 2015 9:19 pm
by another_commander
ocz wrote:
Does this (Re: [FIXED] Music and Sound stuttering with OpenAL) affect the above mentioned crackle problems?
As far as I can tell, there is no difference.

Re: Sound effects

Posted: Wed Dec 09, 2015 9:04 pm
by Fritz
I uploaded version 1.2 of my not-only-engine-sounds OXP. It includes a system shutdown sound when docking and a continuous torus drive sound (using a modulated engine sound file). I also added a cockpit cooling fan that starts when the cabin temperature begins to rise. It's only a small fan, but the implementation is quite complicated, using three sound files for starting, constant running (looping) and stopping. The same technique could be used to simulate the spinning up, running, and shutting down of a generator or something similar, but you need a sound file that contains all three phases to start with.

(I wonder how the core game uses the single injector sound file for creating a similar effect. Could this be made available for the SoundSource object? It would only (?) need 2 additional properties for starting and stopping offsets.)

I've added a switch to disable the BGS ambient sounds, and these sounds now are left on by default (see postings above). The OXP also includes normalized (louder) sound files using Norby's idea to play the sounds using a lower volume.


PS: This thread should probably be moved to the expansion pack section and the title changed to something like "Sound effect OXPs".

Re: Sound effects

Posted: Wed Dec 09, 2015 10:04 pm
by Norby
Fritz wrote:
This thread should probably be moved to the expansion pack section and the title changed to something like "Sound effect OXPs".
You can change the thread title: press the edit button below your first post.
The best way of move and split requests is the red ! button in the bottom right corner of a post.

Re: Sound effect OXPs

Posted: Thu Dec 10, 2015 6:04 am
by Amah
concerning cracking (pops and clicks). Don't know how sophisticated the OOlite sound infrastructure is, and I doubt, antialiasing on the fly is possible, but crossfading like on a dj set (two independent voices on the same channel) might help.

something like this.

/ center \
voc1 voc2
---- ----
loop | vol75
loop | vol25
loop | vol50
loop | vol75
vol75| loop
vol50| loop
vol25| loop
vol0 | loop