|
| Audio (void)=default |
|
| ~Audio (void) |
|
bool | init (Math *m, std::size_t rate) |
| Initializes the manager to work with a given sample rate.
|
|
std::size_t | rate (void) const |
|
std::size_t | n_sources (void) const |
|
bool | read_wav (std::string_view path, std::vector< std::byte > *v) const |
| Reads WAV data from a file.
|
|
bool | write_wav (FILE *f, std::span< const std::byte > s) const |
| Writes WAV data to a file.
|
|
void | gen_wav_header (std::span< std::byte > dst, std::span< const std::byte > src) const |
| Generates WAV header for a buffer.
|
|
std::vector< std::byte > | gen_wav (std::span< const float > s) const |
| Generates a WAV file from floating-point data.
|
|
void | trem (std::span< float > s, float a, float freq, float mix) const |
| Applies a tremolo effect with amplitude a and frequency f .
|
|
void | gen_sine (std::span< float > s, float freq) const |
| Generates a sine wave with amplitude 1 and frequency freq .
|
|
void | gen_sine_fm (std::span< float > s, float freq, float lfo_a, float lfo_freq, float lfo_d) const |
| Generates a sine wave with frequency modulation.
|
|
void | gen_square (std::span< float > s, float freq) const |
| Generates a square wave with amplitude 1 and frequency freq .
|
|
void | gen_saw (std::span< float > s, float freq) const |
| Generates a saw-tooth wave with amplitude 1 and frequency freq .
|
|
void | gen_noise (std::span< float > s) const |
| Generates white (random) noise.
|
|
bool | set_pos (vec3 p) |
|
source | add_source (void) |
|
source | add_source (std::span< const std::byte > v) |
|
bool | remove_source (source s) |
|
vec3 | source_pos (source s) const |
|
std::size_t | source_sample_pos (source s) const |
|
bool | set_source_data (source s, std::size_t channels, std::size_t bit_depth, std::span< const std::byte > v) |
|
bool | set_source_pos (source s, vec3 p) |
|
bool | set_source_sample_pos (source s, std::size_t p) |
|
bool | set_source_loop (source s, bool l) |
|
bool | set_source_gain (source s, float g) |
|
bool | play (source s) const |
|
bool | stop (source s) const |
|
|
static constexpr float | db (float x) |
| Multiplier to decibel conversion.
|
|
static void | gain (std::span< float > s, float g) |
| Applies the gain multiplier to each element.
|
|
static void | over (std::span< float > s, float m, float mix) |
| Applies an overdrive effect with input multiplier m .
|
|
static void | fade (std::span< float > s, float g0, float g1) |
| Linearly fades from g0 to g1 .
|
|
static void | exp_fade (std::span< float > s, std::size_t ep, float g0, float g1, float exp) |
| Exponentially fades from g0 to g1 .
|
|
static void | env (std::span< float > s, std::size_t a, std::size_t d, float st, std::size_t r) |
| Attack/decay/sustain/release envelope.
|
|
static void | mix (std::span< float > dst, std::span< const float > src) |
| Adds the samples from both buffers.
|
|
static void | normalize (std::span< i16 > dst, std::span< const float > src) |
| Generates 16-bit PCM data from floating-point data.
|
|
Audio manager.
Generates, stores, and controls audio streams.