miniaudio: update to 0.11.21

This commit is contained in:
Laytan Laats
2024-02-14 19:57:57 +01:00
parent f378367fe7
commit 16584779fb
16 changed files with 16433 additions and 14008 deletions
+36 -1
View File
@@ -1,6 +1,6 @@
package miniaudio
import c "core:c/libc"
import "core:c"
when ODIN_OS == .Windows {
foreign import lib "lib/miniaudio.lib"
@@ -104,6 +104,13 @@ foreign lib {
Helper for converting gain in decibels to a linear factor.
*/
volume_db_to_linear :: proc(gain: f32) -> f32 ---
/*
Mixes the specified number of frames in floating point format with a volume factor.
This will run on an optimized path when the volume is equal to 1.
*/
ma_mix_pcm_frames_f32 :: proc(pDst: ^f32, pSrc: ^f32, frameCount: u64, channels: u32, volume: f32) -> result ---
}
offset_pcm_frames_ptr_f32 :: #force_inline proc "c" (p: [^]f32, offsetInFrames: u64, channels: u32) -> [^]f32 {
@@ -297,3 +304,31 @@ foreign lib {
paged_audio_buffer_get_cursor_in_pcm_frames :: proc(pPagedAudioBuffer: ^paged_audio_buffer, pCursor: ^u64) -> result ---
paged_audio_buffer_get_length_in_pcm_frames :: proc(pPagedAudioBuffer: ^paged_audio_buffer, pLength: ^u64) -> result ---
}
pulsewave_config :: struct {
format: format,
channels: u32,
sampleRate: u32,
dutyCycle: f64,
amplitude: f64,
frequency: f64,
}
pulsewave :: struct {
waveform: waveform,
config: pulsewave_config,
}
@(default_calling_convention="c", link_prefix="ma_")
foreign lib {
pulsewave_config_init :: proc(format: format, channels: u32, sampleRate: u32, dutyCycle: f64, amplitude: f64, frequency: f64) -> pulsewave_config ---
pulsewave_init :: proc(pConfig: ^pulsewave_config, pWaveForm: ^pulsewave) -> result ---
pulsewave_uninit :: proc(pWaveForm: ^pulsewave) ---
pulsewave_read_pcm_frames :: proc(pWaveForm: ^pulsewave, pFramesOut: rawptr, frameCount: u64, pFramesRead: ^u64) -> result ---
pulsewave_seek_to_pcm_frame :: proc(pWaveForm: ^pulsewave, frameIndex: u64) -> result ---
pulsewave_set_amplitude :: proc(pWaveForm: ^pulsewave, amplitude: f64) -> result ---
pulsewave_set_frequency :: proc(pWaveForm: ^pulsewave, frequency: f64) -> result ---
pulsewave_set_sample_rate :: proc(pWaveForm: ^pulsewave, sampleRate: u32) -> result ---
pulsewave_set_duty_cycle :: proc(pWaveForm: ^pulsewave, dutyCycle: f64) -> result ---
}