Difference between revisions of "Enhanced sound"
(Aded placeholder) |
|||
(4 intermediate revisions by 3 users not shown) | |||
Line 1: | Line 1: | ||
− | + | {{Note|Enhanced sound requires the [http://kcat.strangesoft.net/openal.html OpenAL Soft] driver. See [[#How to get OpenAL Soft|How to get OpenAL Soft]] below.}} | |
+ | |||
+ | |||
+ | Enhanced sound was merged into master on June 1, 2015, as of Git commit d7f54dd. | ||
+ | |||
+ | Enhanced sound adds | ||
+ | *Support for 128 audio channels instead of 32 | ||
+ | *Support for more control over how the game prioritizes sounds in a mission | ||
+ | |||
+ | Enhanced sound is enabled by default, but it's disabled if you are not using [https://openal-soft.org/ OpenAL Soft]. See [[#How to get OpenAL Soft|How to get OpenAL Soft]] below. | ||
+ | |||
+ | You can also manually disable enhanced sound with the "Disable enhanced sound" launcher flag under the "Audio" flags. | ||
+ | |||
+ | ==How to get OpenAL Soft== | ||
+ | ===Windows=== | ||
+ | #First, you need to get the OpenAL32.dll file. You can download version 1.16.0 [http://www.mediafire.com/download/csdkp5psozmq2b1/OpenAL32.dll here]. | ||
+ | #Alternatively, to get OpenAL32.dll from its original source: | ||
+ | ##Download from the [http://kcat.strangesoft.net/openal.html#download OpenAL Soft site] the file whose name ends with "-bin.zip", such as openal-soft-1.16.0-bin.zip. | ||
+ | ##Open the .zip file and rename soft_oal.dll found in the bin\Win32\ folder to OpenAL32.dll. | ||
+ | #Once you have OpenAL32.dll: | ||
+ | #Copy it to your FreeSpace 2 or TC folder. | ||
+ | #Make sure to put a copy of OpenAL32.dll in both your FreeSpace 2 folder and the root folders of any TCs you have. | ||
+ | |||
+ | ===Linux=== | ||
+ | Linux uses OpenAL Soft, so you don't need to do anything. | ||
+ | |||
+ | However, you may wish to build from source either the most recent stable release from the [http://kcat.strangesoft.net/openal.html#download OpenAL Soft site] or even the latest commit from their Git repository. | ||
+ | |||
+ | ===OS X=== | ||
+ | See [http://www.hard-light.net/forums/index.php?topic=89919.0 this thread] for OS X builds that use OpenAL Soft. | ||
+ | |||
+ | ==For modders== | ||
+ | ===Overview=== | ||
+ | Enhanced sound provides control through two values that you can set through extensions of sounds.tbl: | ||
+ | *'''Priority''': how important the sound is | ||
+ | *'''Limit''': how many instances of the sound can be playing at hte same time | ||
+ | |||
+ | The engine has hardcoded default priorities and limits, as described [[#More on default prioritiies/limits|below]]. | ||
+ | |||
+ | You can set custom values for priorities limits using a .tbm file extending sounds.tbl. The [[Sounds.tbl]] page has details on how to specify custom [[Sounds.tbl#+Priority:|priorities]] and [[Sounds.tbl#+Limit:|limits]]. | ||
+ | |||
+ | {{Warning|If you create a TC and want to use enhanced sound, then you '''MUST''' set custom priorities/limits for your TC's gameplay sounds. Otherwise the game may sound strange, because the game will use the default values for FS2 retail.}} | ||
+ | |||
+ | |||
+ | {{Note|If you create an FS2 mod that adds new gameplay sounds, then it is '''strongly''' recommended that you specify priorities/limits for those sounds. | ||
+ | }} | ||
+ | |||
+ | |||
+ | ===More on default prioritiies/limits=== | ||
+ | The FSO engine has hardcoded default priorities limits for the 192 gameplay sound entries in the FS2 retail sounds.tbl. You can see the current list in the source code's [https://github.com/scp-fs2open/fs2open.github.com/blob/master/code/gamesnd/gamesnd.cpp code\gamesnd\gamesnd.cpp] file. | ||
+ | Look for the line starting with | ||
+ | <pre> | ||
+ | static EnhancedSoundData Default_sound_priorities[NUM_RETAIL_GAMEPLAY_SOUNDS] = | ||
+ | </pre> | ||
+ | |||
+ | Sounds outside this range are assigned a generic default priority of Medium-High and limit 1. | ||
+ | |||
+ | |||
+ | ===Tips on selecting priorities/limits=== | ||
+ | |||
+ | The first answer in [http://gamedev.stackexchange.com/questions/2253/audio-design-and-xaudio2-performance-issues this thread] has some details: | ||
+ | |||
+ | "The methods to prioritise [sounds] can include : | ||
+ | |||
+ | "a) Volume - the lowest being the least important. | ||
+ | [''FSO already takes volume into account when deciding whether to replace a currently playing sound.''] | ||
+ | |||
+ | "b) Priority - a value you set yourself based on the importance of the sound and the likely hood that the user will notice the sound dropping out. Background music, for example, should be set to never be dropped. A random cricket sound for ambience should have low priority. | ||
+ | |||
+ | "c) Grouping [or ''limit''] - If you have gunshot sounds for example, once they have hit a hard limit (say 15) you would stop adding new gunshot sounds as they wouldn't add to the overall mix. | ||
+ | [''Grouping/limits is also needed to prevent clipping, which is why in FSO, the warp-in sound has a low limit of 2. The super-loud warp-ins were occurring because this limit wasn't being enforced, meaning there was no limit at all.'']" | ||
+ | |||
+ | [[Category:Modding]] |
Latest revision as of 22:29, 15 December 2022
Enhanced sound was merged into master on June 1, 2015, as of Git commit d7f54dd.
Enhanced sound adds
- Support for 128 audio channels instead of 32
- Support for more control over how the game prioritizes sounds in a mission
Enhanced sound is enabled by default, but it's disabled if you are not using OpenAL Soft. See How to get OpenAL Soft below.
You can also manually disable enhanced sound with the "Disable enhanced sound" launcher flag under the "Audio" flags.
Contents
How to get OpenAL Soft
Windows
- First, you need to get the OpenAL32.dll file. You can download version 1.16.0 here.
- Alternatively, to get OpenAL32.dll from its original source:
- Download from the OpenAL Soft site the file whose name ends with "-bin.zip", such as openal-soft-1.16.0-bin.zip.
- Open the .zip file and rename soft_oal.dll found in the bin\Win32\ folder to OpenAL32.dll.
- Once you have OpenAL32.dll:
- Copy it to your FreeSpace 2 or TC folder.
- Make sure to put a copy of OpenAL32.dll in both your FreeSpace 2 folder and the root folders of any TCs you have.
Linux
Linux uses OpenAL Soft, so you don't need to do anything.
However, you may wish to build from source either the most recent stable release from the OpenAL Soft site or even the latest commit from their Git repository.
OS X
See this thread for OS X builds that use OpenAL Soft.
For modders
Overview
Enhanced sound provides control through two values that you can set through extensions of sounds.tbl:
- Priority: how important the sound is
- Limit: how many instances of the sound can be playing at hte same time
The engine has hardcoded default priorities and limits, as described below.
You can set custom values for priorities limits using a .tbm file extending sounds.tbl. The Sounds.tbl page has details on how to specify custom priorities and limits.
More on default prioritiies/limits
The FSO engine has hardcoded default priorities limits for the 192 gameplay sound entries in the FS2 retail sounds.tbl. You can see the current list in the source code's code\gamesnd\gamesnd.cpp file. Look for the line starting with
static EnhancedSoundData Default_sound_priorities[NUM_RETAIL_GAMEPLAY_SOUNDS] =
Sounds outside this range are assigned a generic default priority of Medium-High and limit 1.
Tips on selecting priorities/limits
The first answer in this thread has some details:
"The methods to prioritise [sounds] can include :
"a) Volume - the lowest being the least important. [FSO already takes volume into account when deciding whether to replace a currently playing sound.]
"b) Priority - a value you set yourself based on the importance of the sound and the likely hood that the user will notice the sound dropping out. Background music, for example, should be set to never be dropped. A random cricket sound for ambience should have low priority.
"c) Grouping [or limit] - If you have gunshot sounds for example, once they have hit a hard limit (say 15) you would stop adding new gunshot sounds as they wouldn't add to the overall mix. [Grouping/limits is also needed to prevent clipping, which is why in FSO, the warp-in sound has a low limit of 2. The super-loud warp-ins were occurring because this limit wasn't being enforced, meaning there was no limit at all.]"