Re: Too many same sound spawns are allowed on selecting the ...
Posted: 07 Feb 2009, 23:25
Some rework
soundfiles can no longer be palyed, instead only SoundItems are played.
You can now specify SoundItems like this:
Priority has the following effect:
When there are not enought sources, then the sound with the lowest priority is stopped (if its 0 or below). This has the effect that sounds with positive priority are never stopped at all.
SoundItems are accessed like normal wav-files has been before. If you access a raw sound file now, a SoundItem with the defaults is created for you.
Additionally, multiple SoundItems can use on single file with different settings, this is very efficient, they only use 1 shared buffer.
Please note that here are also the previously introduced enginesounds. These are put into springcontent.sdz, and not having them in a mod will not fail. So without sounds.lua, you will have the exact behaviour as in 0.78.2.1 except the crash when those files are not present.
soundfiles can no longer be palyed, instead only SoundItems are played.
You can now specify SoundItems like this:
Code: Select all
--- Valid entries used by engine: IncomingChat, MultiSelect, MapPoint
--- other than that, you can give it any name and access it like before with filenames
local Sounds = {
SoundItems = {
IncomingChat = {
file = "sounds/beep4.wav",
},
MultiSelect = {
file = "sounds/button9.wav",
},
MapPoint = {
file = "sounds/beep6.wav",
},
MyAwesomeSouns = {
file = "sounds/booooom.wav",
gain = 2.0, --- for uber-loudness
pitch = 0.2, --- bass-test
priority = 15, --- very high
maxconcurrent = 1, ---only once
maxdist = 500, --- only when near
},
DefaultsForSounds = { -- this are default settings
file = "ThisEntryMustBePresent.wav",
gain = 1.0,
pitch = 1.0,
priority = 0,
maxconcurrent = 16, --- some reasonable limits
maxdist = FLT_MAX, --- no cutoff at all
},
},
}
return Sounds
When there are not enought sources, then the sound with the lowest priority is stopped (if its 0 or below). This has the effect that sounds with positive priority are never stopped at all.
SoundItems are accessed like normal wav-files has been before. If you access a raw sound file now, a SoundItem with the defaults is created for you.
Additionally, multiple SoundItems can use on single file with different settings, this is very efficient, they only use 1 shared buffer.
Please note that here are also the previously introduced enginesounds. These are put into springcontent.sdz, and not having them in a mod will not fail. So without sounds.lua, you will have the exact behaviour as in 0.78.2.1 except the crash when those files are not present.