coastline 0.0.4
Loading...
Searching...
No Matches
soundeffects.h
Go to the documentation of this file.
1#pragma once
2
3#include <filesystem>
4#include <memory>
5
6#include <SDL3/SDL.h>
7
8namespace coastline {
9
12public:
14 enum class Source {
18 };
19
27 SoundEffects(const std::filesystem::path &assets, Source source, bool enabled);
31 SoundEffects(const SoundEffects &) = delete;
34
45 static bool
46 LoadRaceWave(const char *path, int sample, SDL_AudioSpec *spec, Uint8 **data, Uint32 *bytes);
47
58 static bool LoadMenuWave(const std::filesystem::path &path,
59 SDL_AudioSpec *spec,
60 Uint8 **data,
61 Uint32 *bytes);
62
63private:
64 struct State;
66};
67
68} // namespace coastline
SoundEffects & operator=(const SoundEffects &)=delete
Prevent assignment of the registered sound selection context.
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.
SoundEffects(const std::filesystem::path &assets, Source source, bool enabled)
Register the exclusive sound selection context.
Source
The preferred converted race sound library; menu feedback retains front-end samples.
Definition soundeffects.h:14
@ N64
Substitute console samples at matched PC rates and levels; silence unmapped taunts.
Definition soundeffects.h:17
@ Pc
Definition soundeffects.h:15
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.
SoundEffects(const SoundEffects &)=delete
Prevent copying the registered sound selection context.
~SoundEffects()
Unregister sample selection and release cached converted samples.
Definition assetimport.h:11