Converted sound selection and per-sample level matching for one game session.
More...
#include <soundeffects.h>
|
| enum class | Source { Pc
, N64
} |
| | The preferred converted race sound library; menu feedback retains front-end samples. More...
|
|
| static bool | LoadRaceWave (const char *path, int sample, SDL_AudioSpec *spec, Uint8 **data, Uint32 *bytes) |
| | Read a race sample, matching available N64 substitutions to the PC sample's rate and level.
|
| static bool | LoadMenuWave (const std::filesystem::path &path, SDL_AudioSpec *spec, Uint8 **data, Uint32 *bytes) |
| | Read menu feedback as mono unsigned 8-bit PCM at 10999 frames per second.
|
Converted sound selection and per-sample level matching for one game session.
◆ Source
The preferred converted race sound library; menu feedback retains front-end samples.
| Enumerator |
|---|
| Pc | Use the PC race samples at their native playback rates.
|
| N64 | Substitute console samples at matched PC rates and levels; silence unmapped taunts.
|
◆ SoundEffects() [1/2]
Register the exclusive sound selection context.
Another instance must not be active.
- Parameters
-
| assets | The prepared asset directory used to locate console substitutions. |
| source | The preferred race sample library. |
| enabled | Whether loaded samples remain audible; false produces silent samples. |
◆ ~SoundEffects()
| coastline::SoundEffects::~SoundEffects |
( |
| ) |
|
Unregister sample selection and release cached converted samples.
◆ SoundEffects() [2/2]
| coastline::SoundEffects::SoundEffects |
( |
const SoundEffects & | | ) |
|
|
delete |
Prevent copying the registered sound selection context.
◆ operator=()
Prevent assignment of the registered sound selection context.
◆ LoadRaceWave()
| bool coastline::SoundEffects::LoadRaceWave |
( |
const char * | path, |
|
|
int | sample, |
|
|
SDL_AudioSpec * | spec, |
|
|
Uint8 ** | data, |
|
|
Uint32 * | bytes ) |
|
static |
Read a race sample, matching available N64 substitutions to the PC sample's rate and level.
- Parameters
-
| path | The UTF-8 PC reference WAV path, used directly without a matching substitution. |
| sample | The race sound index; N64 mode silences taunts absent from the console. |
| spec | Receives the format of the decoded or converted PCM; must not be null. |
| data | Non-null output pointer for allocated PCM; free with SDL_free() after success. |
| bytes | Receives the PCM byte count; must not be null. |
- Returns
- Whether decoding and allocation succeed. Outputs are unspecified on failure.
◆ LoadMenuWave()
| bool coastline::SoundEffects::LoadMenuWave |
( |
const std::filesystem::path & | path, |
|
|
SDL_AudioSpec * | spec, |
|
|
Uint8 ** | data, |
|
|
Uint32 * | bytes ) |
|
static |
Read menu feedback as mono unsigned 8-bit PCM at 10999 frames per second.
- Parameters
-
| path | The converted front-end WAV file. |
| spec | Receives the PCM format; must not be null. |
| data | Non-null output pointer for allocated PCM; free with SDL_free() after success. |
| bytes | Receives the PCM byte count; must not be null. |
- Returns
- Whether decoding, conversion, and allocation succeed. Outputs are unspecified on failure.
The documentation for this class was generated from the following file: