.. _stdlib_audio: ==================================== Low-level audio bindings (miniaudio) ==================================== .. das:module:: audio Module audio +++++++++ Constants +++++++++ .. _global-audio-MA_SAMPLE_RATE: .. das:attribute:: MA_SAMPLE_RATE = 48000 Audio output sample rate in Hz (default 48000, configured at compile time via CMake). ++++++++++++ Enumerations ++++++++++++ .. _enum-audio-I3DL2Preset: .. das:attribute:: I3DL2Preset I3DL2 reverb environment preset. :Values: * **Generic** = 0 - Generic room with moderate reflections. * **PaddedCell** = 1 - Small padded cell with very short decay. * **Room** = 2 - Standard room. * **Bathroom** = 3 - Bathroom with hard reflective surfaces. * **LivingRoom** = 4 - Living room with moderate absorption. * **StoneRoom** = 5 - Stone room with strong reflections. * **Auditorium** = 6 - Auditorium with long decay. * **ConcertHall** = 7 - Concert hall with rich reverb. * **Cave** = 8 - Cave with very long decay and diffusion. * **Arena** = 9 - Arena with large open space reverb. * **Hangar** = 10 - Hangar with metallic reflections. * **CarpetedHallway** = 11 - Carpeted hallway with damped reflections. * **Hallway** = 12 - Hallway with moderate reflections. * **StoneCorridor** = 13 - Stone corridor with bright reflections. * **Alley** = 14 - Alley with short outdoor reverb. * **Forest** = 15 - Forest with natural outdoor absorption. * **City** = 16 - City with urban reflections. * **Mountains** = 17 - Mountains with distant echoes. * **Quarry** = 18 - Quarry with hard surface reflections. * **Plain** = 19 - Open plain with minimal reverb. * **ParkingLot** = 20 - Parking lot with concrete reflections. * **SewerPipe** = 21 - Sewer pipe with tubular resonance. * **Underwater** = 22 - Underwater with heavily filtered sound. .. _enum-audio-ma_channel_mix_mode: .. das:attribute:: ma_channel_mix_mode Channel mixing strategy when converting between channel counts. :Values: * **ma_channel_mix_mode_rectangular** = 0 - Rectangular panning (simple matrix mix). * **ma_channel_mix_mode_simple** = 1 - Simple channel mapping (drop or duplicate channels). * **ma_channel_mix_mode_custom_weights** = 2 - Custom weight matrix. * **ma_channel_mix_mode_default** = 0 - Default mixing mode. .. _enum-audio-ma_dither_mode: .. das:attribute:: ma_dither_mode Dithering mode for format conversion. :Values: * **ma_dither_mode_none** = 0 - No dithering. * **ma_dither_mode_rectangle** = 1 - Rectangular probability distribution dither. * **ma_dither_mode_triangle** = 2 - Triangular probability distribution dither. .. _enum-audio-ma_format: .. das:attribute:: ma_format Audio sample format. :Values: * **ma_format_unknown** = 0 - Unknown or unspecified format. * **ma_format_u8** = 1 - Unsigned 8-bit integer. * **ma_format_s16** = 2 - Signed 16-bit integer. * **ma_format_s24** = 3 - Signed 24-bit integer (packed). * **ma_format_s32** = 4 - Signed 32-bit integer. * **ma_format_f32** = 5 - 32-bit floating point. .. _enum-audio-ma_resample_algorithm: .. das:attribute:: ma_resample_algorithm Sample rate conversion algorithm. :Values: * **ma_resample_algorithm_linear** = 0 - Linear interpolation. * **ma_resample_algorithm_custom** = 1 - Custom resampling algorithm. .. _enum-audio-ma_result: .. das:attribute:: ma_result Miniaudio result code. :Values: * **MA_SUCCESS** = 0 - Operation completed successfully. * **MA_ERROR** = -1 - Generic error. * **MA_INVALID_ARGS** = -2 - Invalid arguments. * **MA_INVALID_OPERATION** = -3 - Invalid operation for current state. * **MA_OUT_OF_MEMORY** = -4 - Out of memory. * **MA_OUT_OF_RANGE** = -5 - Value out of range. * **MA_ACCESS_DENIED** = -6 - Access denied. * **MA_DOES_NOT_EXIST** = -7 - Resource does not exist. * **MA_ALREADY_EXISTS** = -8 - Resource already exists. * **MA_TOO_MANY_OPEN_FILES** = -9 - Too many open files. * **MA_INVALID_FILE** = -10 - Invalid file. * **MA_TOO_BIG** = -11 - Data too big. * **MA_PATH_TOO_LONG** = -12 - Path too long. * **MA_NAME_TOO_LONG** = -13 - Name too long. * **MA_NOT_DIRECTORY** = -14 - Not a directory. * **MA_IS_DIRECTORY** = -15 - Is a directory. * **MA_DIRECTORY_NOT_EMPTY** = -16 - Directory not empty. * **MA_AT_END** = -17 - Reached end of data. * **MA_NO_SPACE** = -18 - No space available. * **MA_BUSY** = -19 - Resource is busy. * **MA_IO_ERROR** = -20 - I/O error. * **MA_INTERRUPT** = -21 - Operation interrupted. * **MA_UNAVAILABLE** = -22 - Resource unavailable. * **MA_ALREADY_IN_USE** = -23 - Resource already in use. * **MA_BAD_ADDRESS** = -24 - Bad address. * **MA_BAD_SEEK** = -25 - Bad seek position. * **MA_BAD_PIPE** = -26 - Bad pipe. * **MA_DEADLOCK** = -27 - Deadlock detected. * **MA_TOO_MANY_LINKS** = -28 - Too many links. * **MA_NOT_IMPLEMENTED** = -29 - Not implemented. * **MA_NO_MESSAGE** = -30 - No message available. * **MA_BAD_MESSAGE** = -31 - Bad message format. * **MA_NO_DATA_AVAILABLE** = -32 - No data available. * **MA_INVALID_DATA** = -33 - Invalid data. * **MA_TIMEOUT** = -34 - Operation timed out. * **MA_NO_NETWORK** = -35 - No network. * **MA_NOT_UNIQUE** = -36 - Not unique. * **MA_NOT_SOCKET** = -37 - Not a socket. * **MA_NO_ADDRESS** = -38 - No address. * **MA_BAD_PROTOCOL** = -39 - Bad protocol. * **MA_PROTOCOL_UNAVAILABLE** = -40 - Protocol unavailable. * **MA_PROTOCOL_NOT_SUPPORTED** = -41 - Protocol not supported. * **MA_PROTOCOL_FAMILY_NOT_SUPPORTED** = -42 - Protocol family not supported. * **MA_ADDRESS_FAMILY_NOT_SUPPORTED** = -43 - Address family not supported. * **MA_SOCKET_NOT_SUPPORTED** = -44 - Socket not supported. * **MA_CONNECTION_RESET** = -45 - Connection reset. * **MA_ALREADY_CONNECTED** = -46 - Already connected. * **MA_NOT_CONNECTED** = -47 - Not connected. * **MA_CONNECTION_REFUSED** = -48 - Connection refused. * **MA_NO_HOST** = -49 - No host found. * **MA_IN_PROGRESS** = -50 - Operation in progress. * **MA_CANCELLED** = -51 - Operation cancelled. * **MA_MEMORY_ALREADY_MAPPED** = -52 - Memory already mapped. * **MA_FORMAT_NOT_SUPPORTED** = -200 - Audio format not supported. * **MA_DEVICE_TYPE_NOT_SUPPORTED** = -201 - Device type not supported. * **MA_SHARE_MODE_NOT_SUPPORTED** = -202 - Share mode not supported. * **MA_NO_BACKEND** = -203 - No audio backend available. * **MA_NO_DEVICE** = -204 - No audio device found. * **MA_API_NOT_FOUND** = -205 - API not found. * **MA_INVALID_DEVICE_CONFIG** = -206 - Invalid device configuration. * **MA_LOOP** = -207 - Loop detected. * **MA_DEVICE_NOT_INITIALIZED** = -300 - Device not initialized. * **MA_DEVICE_ALREADY_INITIALIZED** = -301 - Device already initialized. * **MA_DEVICE_NOT_STARTED** = -302 - Device not started. * **MA_DEVICE_NOT_STOPPED** = -303 - Device not stopped. * **MA_FAILED_TO_INIT_BACKEND** = -400 - Failed to initialize backend. * **MA_FAILED_TO_OPEN_BACKEND_DEVICE** = -401 - Failed to open backend device. * **MA_FAILED_TO_START_BACKEND_DEVICE** = -402 - Failed to start backend device. * **MA_FAILED_TO_STOP_BACKEND_DEVICE** = -403 - Failed to stop backend device. ++++++++++++++++++ Handled structures ++++++++++++++++++ .. _handle-audio-ma_decoder: .. das:attribute:: ma_decoder Audio decoder instance. Supports WAV, MP3, FLAC, and Vorbis. :Fields: * **outputFormat** : :ref:`ma_format ` - Output audio sample format. * **outputChannels** : uint - Output sample rate in Hz. * **outputSampleRate** : uint - Number of output channels. .. _handle-audio-ma_delay: .. das:attribute:: ma_delay Miniaudio stereo delay effect with an internal ring buffer for storing delayed samples. .. _handle-audio-ma_limiter: .. das:attribute:: ma_limiter Look-ahead brick-wall limiter. :Fields: * **gain** : float[254] - Number of channels. * **nChannels** : uint - Gain reduction buffer. * **attack_samples** : uint - Look-ahead attack in samples. * **threshold** : float - Attack smoothing coefficient. * **attack_coeff** : float - Limiter threshold (0.0 to 1.0). * **release_coeff** : float - Release smoothing coefficient. * **linear_limiter** : float - Linear limiter bypass flag. .. _handle-audio-ma_volume_mixer: .. das:attribute:: ma_volume_mixer Volume and pan processor with fade support. :Fields: * **volume** : float - Target volume for fade. * **dvolume** : float - Number of channels. * **tvolume** : float - Current volume level. * **pan** : float - Stereo pan position (-1.0 left, 1.0 right). * **channels** : uint - Volume delta per frame during fade. .. _handle-audio-I3DL2Reverb: .. das:attribute:: I3DL2Reverb I3DL2 reverb processor instance. .. _handle-audio-ConvolutionReverb: .. das:attribute:: ConvolutionReverb Partitioned FFT convolution reverb with synthetic impulse response. Uses overlap-save convolution with a frequency-domain delay line for efficient real-time processing. :Fields: * **decayTime** : float - decayTime: Reverb decay time in seconds (time to reach -60dB). * **lpFreqStart** : float - lpFreqStart: Lowpass filter starting frequency in Hz. * **lpFreqEnd** : float - lpFreqEnd: Lowpass filter ending frequency at -60dB in Hz. * **fadeIn** : float - fadeIn: Impulse response fade-in time in seconds. * **sampleRate** : uint - sampleRate: Audio sample rate in Hz. * **fft_size** : uint - fft_size: FFT size used for partitioned convolution (2 x block size). * **ir_length** : uint - ir_length: Impulse response length in samples. * **num_partitions** : uint - num_partitions: Number of IR partitions (ir_length / block_size, rounded up). .. _handle-audio-I3DL2ReverbProperties: .. das:attribute:: I3DL2ReverbProperties I3DL2 reverb parameters. :Fields: * **lRoom** : int - Room effect level in millibels. * **lRoomHF** : int - Room effect high-frequency level in millibels. * **flDecayTime** : float - Decay time in seconds. * **flDecayHFRatio** : float - High-frequency decay time ratio. * **lReflections** : int - Early reflections level in millibels. * **flReflectionsDelay** : float - Early reflections delay in seconds. * **lReverb** : int - Late reverb level in millibels. * **flReverbDelay** : float - Late reverb delay in seconds. * **flDiffusion** : float - Echo density percentage (0-100). * **flDensity** : float - Modal density percentage (0-100). .. _handle-audio-ma_sf2_envelope: .. das:attribute:: ma_sf2_envelope SF2 ADSR envelope generator. :Fields: * **stage** : int - Level at start of release phase. * **level** : float - Release time in seconds. * **release_level** : float - Decay time in seconds. * **slope** : float - Current envelope stage. * **is_exponential** : int - Current envelope level. * **is_amp_env** : int - Hold time in seconds. * **midi_velocity** : int - MIDI velocity value (0-127). * **samples_until_next** : float - Samples remaining until next stage transition. * **delay_sec** : float - Current level change rate per sample. * **attack_sec** : float - Delay time in seconds. * **hold_sec** : float - Sustain level (0.0 to 1.0). * **decay_sec** : float - Attack time in seconds. * **sustain_level** : float - Whether this is an amplitude envelope. * **release_sec** : float - Whether decay/release use exponential curves. .. _handle-audio-ma_sf2_voice: .. das:attribute:: ma_sf2_voice SF2 voice -- sample playback with pitch, envelopes, filter, and LFO modulation. :Fields: * **sample_start** : int - Sample loop end position. * **sample_end** : int - Loop mode (0=none, 1=continuous, 3=until release). * **loop_start** : int - Current playback position in samples. * **loop_end** : int - Modulation LFO delay in seconds. * **loop_mode** : int - Right channel sample start offset (stereo). * **sample_start_r** : int - Vibrato LFO delay in seconds. * **sample_end_r** : int - Modulation LFO phase accumulator. * **loop_start_r** : int - Vibrato LFO pitch modulation in cents. * **loop_end_r** : int - Right channel sample end offset (stereo). * **stereo** : int - Whether this is a stereo voice. * **position** : double - Right channel loop end offset (stereo). * **phase_inc** : double - Biquad resonant filter state. * **vol_env** : :ref:`ma_sf2_envelope ` - Pitch bend offset in cents. * **mod_env** : :ref:`ma_sf2_envelope ` - Whether note-off has been received. * **filter** : :ref:`ma_sf2_biquad ` - Whether the voice has finished playing. * **filter_r** : :ref:`ma_sf2_biquad ` - Modulation envelope state. * **initial_filter_fc** : float - Sample loop start position. * **initial_filter_q** : float - Modulation LFO elapsed time. * **mod_env_to_pitch** : float - Volume attenuation in centibels. * **mod_lfo_to_pitch** : float - Base sample rate in Hz. * **vib_lfo_to_pitch** : float - Right channel loop start offset (stereo). * **mod_env_to_filter_fc** : float - Vibrato LFO phase accumulator. * **mod_lfo_to_filter_fc** : float - Volume envelope state. * **mod_lfo_to_volume** : float - Phase increment per output sample. * **mod_lfo_phase** : float - Stereo pan position (-0.5 left, 0.5 right). * **mod_lfo_freq** : float - Modulation LFO to volume depth in centibels. * **mod_lfo_delay** : float - Initial filter resonance Q. * **mod_lfo_elapsed** : float - Modulation envelope to pitch depth in cents. * **vib_lfo_phase** : float - Sample end position. * **vib_lfo_freq** : float - Modulation LFO to pitch depth in cents. * **vib_lfo_delay** : float - Modulation envelope to filter cutoff depth in cents. * **vib_lfo_elapsed** : float - Modulation LFO to filter cutoff depth in cents. * **pitch_bend_cents** : float - Initial filter cutoff frequency in cents. * **attenuation** : float - Vibrato LFO frequency in Hz. * **pan** : float - Vibrato LFO elapsed time. * **released** : int - Modulation LFO frequency in Hz. * **finished** : int - Sample start position. * **sample_rate** : float - Right channel biquad filter state (stereo). .. _handle-audio-ma_decoder_config: .. das:attribute:: ma_decoder_config Audio decoder configuration. :Fields: * **format** : :ref:`ma_format ` - Number of output channels. * **channels** : uint - Channel mixing mode. * **channelMap** : uint8? - Dithering mode for format conversion. * **channelMixMode** : :ref:`ma_channel_mix_mode ` - Channel mapping array (null for default). * **ditherMode** : :ref:`ma_dither_mode ` - Output sample format. .. _handle-audio-ma_channel_converter_config: .. das:attribute:: ma_channel_converter_config Channel converter configuration. :Fields: * **format** : :ref:`ma_format ` - Number of input channels. * **channelsIn** : uint - Number of output channels. * **channelsOut** : uint - Channel mixing mode. * **channelMapIn** : uint8? - Custom mixing weight matrix (null for default). * **channelMapOut** : uint8? - Input channel map (null for default). * **mixingMode** : :ref:`ma_channel_mix_mode ` - Sample format. * **weights** : float?? - Output channel map (null for default). .. _handle-audio-ma_hrtf: .. das:attribute:: ma_hrtf HRTF binaural 3D audio processor using CIPIC database. :Fields: * **taps** : uint - Number of filter taps. * **azimuth** : int - Left ear FIR filter pointer. * **elevation** : int - Elevation angle in degrees. * **sampleRate** : uint - Azimuth angle in degrees. * **leftfip** : int16? - Right ear FIR filter pointer. * **rightfip** : int16? - FFT size. * **fft_size** : uint - Sample rate in Hz. .. _handle-audio-ma_resampler_config: .. das:attribute:: ma_resampler_config Sample rate converter configuration. :Fields: * **format** : :ref:`ma_format ` - Number of channels. * **channels** : uint - Sample format. * **sampleRateIn** : uint - Output sample rate in Hz. * **sampleRateOut** : uint - Input sample rate in Hz. .. _handle-audio-ma_channel_converter: .. das:attribute:: ma_channel_converter Channel layout converter instance (e.g. mono to stereo). .. _handle-audio-ma_resampler: .. das:attribute:: ma_resampler Sample rate converter instance. :Fields: * **format** : :ref:`ma_format ` - Number of channels. * **channels** : uint - Sample format. * **sampleRateIn** : uint - Output sample rate in Hz. * **sampleRateOut** : uint - Input sample rate in Hz. .. _handle-audio-ma_chorus_config: .. das:attribute:: ma_chorus_config Chorus effect configuration. :Fields: * **rate** : float - Base delay in milliseconds. * **depth** : float - LFO modulation rate in Hz. * **feedback** : float - Wet/dry mix (0.0 dry, 1.0 fully wet). * **delay_ms** : float - LFO modulation depth. * **wet** : float - Feedback amount. .. _handle-audio-ma_sf2_biquad: .. das:attribute:: ma_sf2_biquad SF2 biquad resonant filter (transposed direct form II). :Fields: * **q_inv** : double - Inverse of Q (resonance). * **a0** : double - Feedforward coefficient a0. * **a1** : double - Feedforward coefficient a1. * **b1** : double - Feedback coefficient b1. * **b2** : double - Feedback coefficient b2. * **z1** : double - Filter state z1. * **z2** : double - Filter state z2. * **active** : int - Whether the filter is active. .. _handle-audio-ma_chorus: .. das:attribute:: ma_chorus Stereo chorus processor with 4 modulated delay taps. ++++++++++++ Audio device ++++++++++++ * :ref:`mixer_context () : Context& ` * :ref:`sound_finalize () ` * :ref:`sound_initalize (mixer: function\<(array\#;int;int;float):void\>; rate: int; channels: int; context: Context) : bool ` .. _function-audio_mixer_context: .. das:function:: mixer_context() : Context& Get the audio mixer thread's context. .. _function-audio_sound_finalize: .. das:function:: sound_finalize() Shut down the audio device and release resources. .. _function-audio_sound_initalize_function_ls_array_ls_float_gr__hh_;int;int;float_c_void_gr__int_int_Context: .. das:function:: sound_initalize(mixer: function<(array#;int;int;float):void>; rate: int; channels: int; context: Context) : bool Initialize the audio device with a mixer callback. Call once before any audio playback. :Arguments: * **mixer** : function<(array\ #;int;int;float):void> * **rate** : int * **channels** : int * **context** : :ref:`Context ` implicit +++++++ Decoder +++++++ * :ref:`ma_decoder_config_init (outputFormat: ma_format; outputChannels: uint; outputSampleRate: uint) : ma_decoder_config ` * :ref:`ma_decoder_config_init_default () : ma_decoder_config ` * :ref:`ma_decoder_get_available_frames (decoder: ma_decoder?; pAvailableFrames: uint64?) : ma_result ` * :ref:`ma_decoder_get_cursor_in_pcm_frames (decoder: ma_decoder?; pCursor: uint64?) : ma_result ` * :ref:`ma_decoder_get_length_in_pcm_frames (decoder: ma_decoder?) : uint64 ` * :ref:`ma_decoder_init_file (pFilePath: string; config: ma_decoder_config const?; decoder: ma_decoder?) : ma_result ` * :ref:`ma_decoder_init_memory (pData: void?; dataSize: uint64; config: ma_decoder_config const?; decoder: ma_decoder?) : ma_result ` * :ref:`ma_decoder_read_pcm_frames (decoder: ma_decoder?; pFramesOut: void?; frameCount: uint64) : uint64 ` * :ref:`ma_decoder_seek_to_pcm_frame (decoder: ma_decoder?; frameIndex: uint64) : ma_result ` * :ref:`ma_decoder_uninit (decoder: ma_decoder?) : ma_result ` .. _function-audio_ma_decoder_config_init_ma_format_uint_uint: .. das:function:: ma_decoder_config_init(outputFormat: ma_format; outputChannels: uint; outputSampleRate: uint) : ma_decoder_config Create a decoder config with the specified output format, channels, and sample rate. :Arguments: * **outputFormat** : :ref:`ma_format ` * **outputChannels** : uint * **outputSampleRate** : uint .. _function-audio_ma_decoder_config_init_default: .. das:function:: ma_decoder_config_init_default() : ma_decoder_config Create a decoder config with default settings (auto-detect format). .. _function-audio_ma_decoder_get_available_frames_ma_decoder_q__uint64_q_: .. das:function:: ma_decoder_get_available_frames(decoder: ma_decoder?; pAvailableFrames: uint64?) : ma_result Get the number of frames available for reading. :Arguments: * **decoder** : :ref:`ma_decoder `? implicit * **pAvailableFrames** : uint64? implicit .. _function-audio_ma_decoder_get_cursor_in_pcm_frames_ma_decoder_q__uint64_q_: .. das:function:: ma_decoder_get_cursor_in_pcm_frames(decoder: ma_decoder?; pCursor: uint64?) : ma_result Get the current read position in PCM frames. :Arguments: * **decoder** : :ref:`ma_decoder `? implicit * **pCursor** : uint64? implicit .. _function-audio_ma_decoder_get_length_in_pcm_frames_ma_decoder_q_: .. das:function:: ma_decoder_get_length_in_pcm_frames(decoder: ma_decoder?) : uint64 Get the total length of the audio in PCM frames. :Arguments: * **decoder** : :ref:`ma_decoder `? implicit .. _function-audio_ma_decoder_init_file_string_ma_decoder_config_const_q__ma_decoder_q_: .. das:function:: ma_decoder_init_file(pFilePath: string; config: ma_decoder_config const?; decoder: ma_decoder?) : ma_result Initialize a decoder from an audio file path. Supports WAV, MP3, FLAC, and Vorbis. :Arguments: * **pFilePath** : string implicit * **config** : :ref:`ma_decoder_config `? implicit * **decoder** : :ref:`ma_decoder `? implicit .. _function-audio_ma_decoder_init_memory_void_q__uint64_ma_decoder_config_const_q__ma_decoder_q_: .. das:function:: ma_decoder_init_memory(pData: void?; dataSize: uint64; config: ma_decoder_config const?; decoder: ma_decoder?) : ma_result Initialize a decoder from an in-memory audio buffer. :Arguments: * **pData** : void? implicit * **dataSize** : uint64 * **config** : :ref:`ma_decoder_config `? implicit * **decoder** : :ref:`ma_decoder `? implicit .. _function-audio_ma_decoder_read_pcm_frames_ma_decoder_q__void_q__uint64: .. das:function:: ma_decoder_read_pcm_frames(decoder: ma_decoder?; pFramesOut: void?; frameCount: uint64) : uint64 Read PCM frames from the decoder into a buffer. Returns the number of frames actually read. :Arguments: * **decoder** : :ref:`ma_decoder `? implicit * **pFramesOut** : void? implicit * **frameCount** : uint64 .. _function-audio_ma_decoder_seek_to_pcm_frame_ma_decoder_q__uint64: .. das:function:: ma_decoder_seek_to_pcm_frame(decoder: ma_decoder?; frameIndex: uint64) : ma_result Seek to a specific PCM frame position. :Arguments: * **decoder** : :ref:`ma_decoder `? implicit * **frameIndex** : uint64 .. _function-audio_ma_decoder_uninit_ma_decoder_q_: .. das:function:: ma_decoder_uninit(decoder: ma_decoder?) : ma_result Uninitialize a decoder and release its resources. :Arguments: * **decoder** : :ref:`ma_decoder `? implicit +++++++++ Resampler +++++++++ * :ref:`ma_resampler_config_init (format: ma_format; channels: uint; sampleRateIn: uint; sampleRateOut: uint; algorithm: ma_resample_algorithm) : ma_resampler_config ` * :ref:`ma_resampler_disable_linear_filtering (config: ma_resampler_config?) ` * :ref:`ma_resampler_get_expected_output_frame_count (resampler: ma_resampler const?; inputFrameCount: uint64) : uint64 ` * :ref:`ma_resampler_get_input_latency (resampler: ma_resampler const?) : uint64 ` * :ref:`ma_resampler_get_output_latency (resampler: ma_resampler const?) : uint64 ` * :ref:`ma_resampler_get_required_input_frame_count (resampler: ma_resampler const?; outputFrameCount: uint64) : uint64 ` * :ref:`ma_resampler_init (config: ma_resampler_config const?; resampler: ma_resampler?) : ma_result ` * :ref:`ma_resampler_process_pcm_frames (resampler: ma_resampler?; pFramesIn: void?; pFrameCountIn: uint64?; pFramesOut: void?; pFrameCountOut: uint64?) : ma_result ` * :ref:`ma_resampler_set_rate (resampler: ma_resampler?; sampleRateIn: uint; sampleRateOut: uint) : ma_result ` * :ref:`ma_resampler_set_rate_ratio (resampler: ma_resampler?; ratioInOut: float) : ma_result ` * :ref:`ma_resampler_uninit (resampler: ma_resampler?) ` .. _function-audio_ma_resampler_config_init_ma_format_uint_uint_uint_ma_resample_algorithm: .. das:function:: ma_resampler_config_init(format: ma_format; channels: uint; sampleRateIn: uint; sampleRateOut: uint; algorithm: ma_resample_algorithm) : ma_resampler_config Create a resampler config with format, channels, input rate, output rate, and algorithm. :Arguments: * **format** : :ref:`ma_format ` * **channels** : uint * **sampleRateIn** : uint * **sampleRateOut** : uint * **algorithm** : :ref:`ma_resample_algorithm ` .. _function-audio_ma_resampler_disable_linear_filtering_ma_resampler_config_q_: .. das:function:: ma_resampler_disable_linear_filtering(config: ma_resampler_config?) Disable linear interpolation filtering on the resampler config. :Arguments: * **config** : :ref:`ma_resampler_config `? implicit .. _function-audio_ma_resampler_get_expected_output_frame_count_ma_resampler_const_q__uint64: .. das:function:: ma_resampler_get_expected_output_frame_count(resampler: ma_resampler const?; inputFrameCount: uint64) : uint64 Get how many output frames will be produced from the given input frames. :Arguments: * **resampler** : :ref:`ma_resampler `? implicit * **inputFrameCount** : uint64 .. _function-audio_ma_resampler_get_input_latency_ma_resampler_const_q_: .. das:function:: ma_resampler_get_input_latency(resampler: ma_resampler const?) : uint64 Get the input latency in frames. :Arguments: * **resampler** : :ref:`ma_resampler `? implicit .. _function-audio_ma_resampler_get_output_latency_ma_resampler_const_q_: .. das:function:: ma_resampler_get_output_latency(resampler: ma_resampler const?) : uint64 Get the output latency in frames. :Arguments: * **resampler** : :ref:`ma_resampler `? implicit .. _function-audio_ma_resampler_get_required_input_frame_count_ma_resampler_const_q__uint64: .. das:function:: ma_resampler_get_required_input_frame_count(resampler: ma_resampler const?; outputFrameCount: uint64) : uint64 Get how many input frames are needed to produce the given output frames. :Arguments: * **resampler** : :ref:`ma_resampler `? implicit * **outputFrameCount** : uint64 .. _function-audio_ma_resampler_init_ma_resampler_config_const_q__ma_resampler_q_: .. das:function:: ma_resampler_init(config: ma_resampler_config const?; resampler: ma_resampler?) : ma_result Initialize a resampler from a config. :Arguments: * **config** : :ref:`ma_resampler_config `? implicit * **resampler** : :ref:`ma_resampler `? implicit .. _function-audio_ma_resampler_process_pcm_frames_ma_resampler_q__void_q__uint64_q__void_q__uint64_q_: .. das:function:: ma_resampler_process_pcm_frames(resampler: ma_resampler?; pFramesIn: void?; pFrameCountIn: uint64?; pFramesOut: void?; pFrameCountOut: uint64?) : ma_result Process PCM frames through the resampler, converting between sample rates. :Arguments: * **resampler** : :ref:`ma_resampler `? implicit * **pFramesIn** : void? implicit * **pFrameCountIn** : uint64? implicit * **pFramesOut** : void? implicit * **pFrameCountOut** : uint64? implicit .. _function-audio_ma_resampler_set_rate_ma_resampler_q__uint_uint: .. das:function:: ma_resampler_set_rate(resampler: ma_resampler?; sampleRateIn: uint; sampleRateOut: uint) : ma_result Change the input and output sample rates dynamically. :Arguments: * **resampler** : :ref:`ma_resampler `? implicit * **sampleRateIn** : uint * **sampleRateOut** : uint .. _function-audio_ma_resampler_set_rate_ratio_ma_resampler_q__float: .. das:function:: ma_resampler_set_rate_ratio(resampler: ma_resampler?; ratioInOut: float) : ma_result Set the resampling ratio directly as a float. :Arguments: * **resampler** : :ref:`ma_resampler `? implicit * **ratioInOut** : float .. _function-audio_ma_resampler_uninit_ma_resampler_q_: .. das:function:: ma_resampler_uninit(resampler: ma_resampler?) Uninitialize a resampler. :Arguments: * **resampler** : :ref:`ma_resampler `? implicit +++++++++++++++++ Channel converter +++++++++++++++++ * :ref:`ma_channel_converter_config_init (format: ma_format; channelsIn: uint; channelsOut: uint8 const?; channelMapIn: uint; channelMapOut: uint8 const?; mixingMode: ma_channel_mix_mode) : ma_channel_converter_config ` * :ref:`ma_channel_converter_init (config: ma_channel_converter_config const?; converter: ma_channel_converter?) : ma_result ` * :ref:`ma_channel_converter_process_pcm_frames (converter: ma_channel_converter?; pFramesOut: void?; pFramesIn: void?; frameCount: uint64) : ma_result ` * :ref:`ma_channel_converter_uninit (converter: ma_channel_converter?) ` .. _function-audio_ma_channel_converter_config_init_ma_format_uint_uint8_const_q__uint_uint8_const_q__ma_channel_mix_mode: .. das:function:: ma_channel_converter_config_init(format: ma_format; channelsIn: uint; channelsOut: uint8 const?; channelMapIn: uint; channelMapOut: uint8 const?; mixingMode: ma_channel_mix_mode) : ma_channel_converter_config Create a channel converter config for converting between channel layouts. :Arguments: * **format** : :ref:`ma_format ` * **channelsIn** : uint * **channelsOut** : uint8? implicit * **channelMapIn** : uint * **channelMapOut** : uint8? implicit * **mixingMode** : :ref:`ma_channel_mix_mode ` .. _function-audio_ma_channel_converter_init_ma_channel_converter_config_const_q__ma_channel_converter_q_: .. das:function:: ma_channel_converter_init(config: ma_channel_converter_config const?; converter: ma_channel_converter?) : ma_result Initialize a channel converter from a config. :Arguments: * **config** : :ref:`ma_channel_converter_config `? implicit * **converter** : :ref:`ma_channel_converter `? implicit .. _function-audio_ma_channel_converter_process_pcm_frames_ma_channel_converter_q__void_q__void_q__uint64: .. das:function:: ma_channel_converter_process_pcm_frames(converter: ma_channel_converter?; pFramesOut: void?; pFramesIn: void?; frameCount: uint64) : ma_result Convert PCM frames between channel layouts (e.g. mono to stereo). :Arguments: * **converter** : :ref:`ma_channel_converter `? implicit * **pFramesOut** : void? implicit * **pFramesIn** : void? implicit * **frameCount** : uint64 .. _function-audio_ma_channel_converter_uninit_ma_channel_converter_q_: .. das:function:: ma_channel_converter_uninit(converter: ma_channel_converter?) Uninitialize a channel converter. :Arguments: * **converter** : :ref:`ma_channel_converter `? implicit ++++++++++++ Volume mixer ++++++++++++ * :ref:`ma_volume_mixer_init (mixer: ma_volume_mixer?; nChannels: uint) ` * :ref:`ma_volume_mixer_process_pcm_frames (mixer: ma_volume_mixer?; pFramesOut: float?; pFramesIn: float?; frameCount: uint64) ` * :ref:`ma_volume_mixer_set_channels (mixer: ma_volume_mixer?; nChannels: uint) ` * :ref:`ma_volume_mixer_set_linear_pan (mixer: ma_volume_mixer?; linearPan: bool) ` * :ref:`ma_volume_mixer_set_pan (mixer: ma_volume_mixer?; pan: float) ` * :ref:`ma_volume_mixer_set_pan_immediate (mixer: ma_volume_mixer?; pan: float) ` * :ref:`ma_volume_mixer_set_volume (mixer: ma_volume_mixer?; volume: float) ` * :ref:`ma_volume_mixer_set_volume_over_time (mixer: ma_volume_mixer?; volume: float; nFrames: uint64) ` * :ref:`ma_volume_mixer_uninit (mixer: ma_volume_mixer?) ` .. _function-audio_ma_volume_mixer_init_ma_volume_mixer_q__uint: .. das:function:: ma_volume_mixer_init(mixer: ma_volume_mixer?; nChannels: uint) Initialize a volume mixer with the specified number of channels. :Arguments: * **mixer** : :ref:`ma_volume_mixer `? implicit * **nChannels** : uint .. _function-audio_ma_volume_mixer_process_pcm_frames_ma_volume_mixer_q__float_q__float_q__uint64: .. das:function:: ma_volume_mixer_process_pcm_frames(mixer: ma_volume_mixer?; pFramesOut: float?; pFramesIn: float?; frameCount: uint64) Apply volume, pan, and fading to PCM frames. :Arguments: * **mixer** : :ref:`ma_volume_mixer `? implicit * **pFramesOut** : float? implicit * **pFramesIn** : float? implicit * **frameCount** : uint64 .. _function-audio_ma_volume_mixer_set_channels_ma_volume_mixer_q__uint: .. das:function:: ma_volume_mixer_set_channels(mixer: ma_volume_mixer?; nChannels: uint) Set the number of channels for the volume mixer. :Arguments: * **mixer** : :ref:`ma_volume_mixer `? implicit * **nChannels** : uint .. _function-audio_ma_volume_mixer_set_linear_pan_ma_volume_mixer_q__bool: .. das:function:: ma_volume_mixer_set_linear_pan(mixer: ma_volume_mixer?; linearPan: bool) Enable or disable linear panning mode on the volume mixer. When enabled, pan uses linear gain curves; when disabled, it uses equal-power (constant-power) panning. :Arguments: * **mixer** : :ref:`ma_volume_mixer `? implicit * **linearPan** : bool .. _function-audio_ma_volume_mixer_set_pan_ma_volume_mixer_q__float: .. das:function:: ma_volume_mixer_set_pan(mixer: ma_volume_mixer?; pan: float) Set stereo pan position (-1.0 left to 1.0 right). :Arguments: * **mixer** : :ref:`ma_volume_mixer `? implicit * **pan** : float .. _function-audio_ma_volume_mixer_set_pan_immediate_ma_volume_mixer_q__float: .. das:function:: ma_volume_mixer_set_pan_immediate(mixer: ma_volume_mixer?; pan: float) Set the stereo pan position on the volume mixer immediately without any smoothing or interpolation, where -1.0 is full left and 1.0 is full right. :Arguments: * **mixer** : :ref:`ma_volume_mixer `? implicit * **pan** : float .. _function-audio_ma_volume_mixer_set_volume_ma_volume_mixer_q__float: .. das:function:: ma_volume_mixer_set_volume(mixer: ma_volume_mixer?; volume: float) Set the volume level (0.0 to 1.0+). :Arguments: * **mixer** : :ref:`ma_volume_mixer `? implicit * **volume** : float .. _function-audio_ma_volume_mixer_set_volume_over_time_ma_volume_mixer_q__float_uint64: .. das:function:: ma_volume_mixer_set_volume_over_time(mixer: ma_volume_mixer?; volume: float; nFrames: uint64) Set volume with a fade over the specified number of frames. :Arguments: * **mixer** : :ref:`ma_volume_mixer `? implicit * **volume** : float * **nFrames** : uint64 .. _function-audio_ma_volume_mixer_uninit_ma_volume_mixer_q_: .. das:function:: ma_volume_mixer_uninit(mixer: ma_volume_mixer?) Uninitialize a volume mixer. :Arguments: * **mixer** : :ref:`ma_volume_mixer `? implicit +++++++ Limiter +++++++ * :ref:`ma_limiter_get_required_input_frame_count (limiter: ma_limiter?; out_len: uint64) : uint64 ` * :ref:`ma_limiter_init (limiter: ma_limiter?; threshold: float; attack_time: float; release_time: float; sample_rate: float; nChannels: uint) ` * :ref:`ma_limiter_init_linear (limiter: ma_limiter?; nChannels: uint) ` * :ref:`ma_limiter_process_pcm_frames (limiter: ma_limiter?; InFames: float?; OutFrames: float?; nFrames: uint64) ` * :ref:`ma_limiter_uninit (limiter: ma_limiter?) ` .. _function-audio_ma_limiter_get_required_input_frame_count_ma_limiter_q__uint64: .. das:function:: ma_limiter_get_required_input_frame_count(limiter: ma_limiter?; out_len: uint64) : uint64 Get how many input frames are needed for the given output frames. :Arguments: * **limiter** : :ref:`ma_limiter `? implicit * **out_len** : uint64 .. _function-audio_ma_limiter_init_ma_limiter_q__float_float_float_float_uint: .. das:function:: ma_limiter_init(limiter: ma_limiter?; threshold: float; attack_time: float; release_time: float; sample_rate: float; nChannels: uint) Initialize a look-ahead limiter with threshold, attack, release, and sample rate. :Arguments: * **limiter** : :ref:`ma_limiter `? implicit * **threshold** : float * **attack_time** : float * **release_time** : float * **sample_rate** : float * **nChannels** : uint .. _function-audio_ma_limiter_init_linear_ma_limiter_q__uint: .. das:function:: ma_limiter_init_linear(limiter: ma_limiter?; nChannels: uint) Initialize a limiter in linear (pass-through) mode. :Arguments: * **limiter** : :ref:`ma_limiter `? implicit * **nChannels** : uint .. _function-audio_ma_limiter_process_pcm_frames_ma_limiter_q__float_q__float_q__uint64: .. das:function:: ma_limiter_process_pcm_frames(limiter: ma_limiter?; InFames: float?; OutFrames: float?; nFrames: uint64) Process PCM frames through the limiter. :Arguments: * **limiter** : :ref:`ma_limiter `? implicit * **InFames** : float? implicit * **OutFrames** : float? implicit * **nFrames** : uint64 .. _function-audio_ma_limiter_uninit_ma_limiter_q_: .. das:function:: ma_limiter_uninit(limiter: ma_limiter?) Uninitialize a limiter. :Arguments: * **limiter** : :ref:`ma_limiter `? implicit ++++ HRTF ++++ * :ref:`ma_hrtf_init (hrtf: ma_hrtf?; sampleRate: uint) ` * :ref:`ma_hrtf_process_frames (hrtf: ma_hrtf?; pOut: float?; pIn: float const?; nChannels: uint; frameCount: uint) ` * :ref:`ma_hrtf_set_direction (hrtf: ma_hrtf?; azimuth: int; elevation: int) ` * :ref:`ma_hrtf_uninit (hrtf: ma_hrtf?) ` .. _function-audio_ma_hrtf_init_ma_hrtf_q__uint: .. das:function:: ma_hrtf_init(hrtf: ma_hrtf?; sampleRate: uint) Initialize HRTF processor for binaural 3D audio at the given sample rate. :Arguments: * **hrtf** : :ref:`ma_hrtf `? implicit * **sampleRate** : uint .. _function-audio_ma_hrtf_process_frames_ma_hrtf_q__float_q__float_const_q__uint_uint: .. das:function:: ma_hrtf_process_frames(hrtf: ma_hrtf?; pOut: float?; pIn: float const?; nChannels: uint; frameCount: uint) Process mono input frames through HRTF, producing stereo output with spatial positioning. :Arguments: * **hrtf** : :ref:`ma_hrtf `? implicit * **pOut** : float? implicit * **pIn** : float? implicit * **nChannels** : uint * **frameCount** : uint .. _function-audio_ma_hrtf_set_direction_ma_hrtf_q__int_int: .. das:function:: ma_hrtf_set_direction(hrtf: ma_hrtf?; azimuth: int; elevation: int) Set the sound source direction as azimuth and elevation in degrees. :Arguments: * **hrtf** : :ref:`ma_hrtf `? implicit * **azimuth** : int * **elevation** : int .. _function-audio_ma_hrtf_uninit_ma_hrtf_q_: .. das:function:: ma_hrtf_uninit(hrtf: ma_hrtf?) Uninitialize HRTF processor and release resources. :Arguments: * **hrtf** : :ref:`ma_hrtf `? implicit ++++++++++++ I3DL2 Reverb ++++++++++++ * :ref:`get_preset (preset: I3DL2Preset) : I3DL2ReverbProperties& ` * :ref:`process_mono (reverb: I3DL2Reverb?; input: float?; output: float?; nSamples: int) ` * :ref:`process_stereo (reverb: I3DL2Reverb?; input: float?; output: float?; nSamples: int) ` * :ref:`set_properties (reverb: I3DL2Reverb?; props: I3DL2ReverbProperties) ` * :ref:`set_sample_rate (reverb: I3DL2Reverb?; rate: float) ` .. _function-audio_get_preset_I3DL2Preset: .. das:function:: get_preset(preset: I3DL2Preset) : I3DL2ReverbProperties& Get the I3DL2ReverbProperties for a named preset. :Arguments: * **preset** : :ref:`I3DL2Preset ` .. _function-audio_process_mono_I3DL2Reverb_q__float_q__float_q__int: .. das:function:: process_mono(reverb: I3DL2Reverb?; input: float?; output: float?; nSamples: int) Process mono audio through the reverb, producing stereo wet output. :Arguments: * **reverb** : :ref:`I3DL2Reverb `? implicit * **input** : float? implicit * **output** : float? implicit * **nSamples** : int .. _function-audio_process_stereo_I3DL2Reverb_q__float_q__float_q__int: .. das:function:: process_stereo(reverb: I3DL2Reverb?; input: float?; output: float?; nSamples: int) Process stereo audio through the reverb. :Arguments: * **reverb** : :ref:`I3DL2Reverb `? implicit * **input** : float? implicit * **output** : float? implicit * **nSamples** : int .. _function-audio_set_properties_I3DL2Reverb_q__I3DL2ReverbProperties: .. das:function:: set_properties(reverb: I3DL2Reverb?; props: I3DL2ReverbProperties) Set reverb parameters from an I3DL2ReverbProperties struct. :Arguments: * **reverb** : :ref:`I3DL2Reverb `? implicit * **props** : :ref:`I3DL2ReverbProperties ` implicit .. _function-audio_set_sample_rate_I3DL2Reverb_q__float: .. das:function:: set_sample_rate(reverb: I3DL2Reverb?; rate: float) Set the reverb processor's sample rate. :Arguments: * **reverb** : :ref:`I3DL2Reverb `? implicit * **rate** : float ++++++++++++++++++ Convolution Reverb ++++++++++++++++++ * :ref:`conv_reverb_get_max_ir () : float ` * :ref:`conv_reverb_init (reverb: ConvolutionReverb?; sample_rate: int; decay_time: float; lp_freq_start: float; lp_freq_end: float; fade_in: float) ` * :ref:`conv_reverb_process (reverb: ConvolutionReverb?; input: float?; output: float?; nFrames: int) ` * :ref:`conv_reverb_process_mono (reverb: ConvolutionReverb?; input: float?; output: float?; nSamples: int) ` * :ref:`conv_reverb_set_max_ir (seconds: float) ` * :ref:`conv_reverb_uninit (reverb: ConvolutionReverb?) ` .. _function-audio_conv_reverb_get_max_ir: .. das:function:: conv_reverb_get_max_ir() : float Returns the current maximum impulse response length in seconds. See ``conv_reverb_set_max_ir``. .. _function-audio_conv_reverb_init_ConvolutionReverb_q__int_float_float_float_float: .. das:function:: conv_reverb_init(reverb: ConvolutionReverb?; sample_rate: int; decay_time: float; lp_freq_start: float; lp_freq_end: float; fade_in: float) Initialize a convolution reverb with a synthetic impulse response. Generates random noise with exponential decay and a gradient lowpass sweep, then partitions it for efficient FFT-based convolution. ``decay_time`` is the -60dB fade time in seconds. ``lp_freq_start`` and ``lp_freq_end`` control the lowpass sweep from bright to dark over the decay. ``fade_in`` ramps the IR onset to avoid clicks. :Arguments: * **reverb** : :ref:`ConvolutionReverb `? implicit * **sample_rate** : int * **decay_time** : float * **lp_freq_start** : float * **lp_freq_end** : float * **fade_in** : float .. _function-audio_conv_reverb_process_ConvolutionReverb_q__float_q__float_q__int: .. das:function:: conv_reverb_process(reverb: ConvolutionReverb?; input: float?; output: float?; nFrames: int) Process interleaved stereo audio through the convolution reverb. Input is downmixed to mono, then convolved with separate L/R impulse responses for stereo decorrelation. Output is interleaved stereo. ``nFrames`` is the number of stereo frames (not samples). :Arguments: * **reverb** : :ref:`ConvolutionReverb `? implicit * **input** : float? implicit * **output** : float? implicit * **nFrames** : int .. _function-audio_conv_reverb_process_mono_ConvolutionReverb_q__float_q__float_q__int: .. das:function:: conv_reverb_process_mono(reverb: ConvolutionReverb?; input: float?; output: float?; nSamples: int) Process mono audio through the convolution reverb (left IR only). ``nSamples`` is the number of mono samples. Used for baking reverb into pre-rendered drum buffers. :Arguments: * **reverb** : :ref:`ConvolutionReverb `? implicit * **input** : float? implicit * **output** : float? implicit * **nSamples** : int .. _function-audio_conv_reverb_set_max_ir_float: .. das:function:: conv_reverb_set_max_ir(seconds: float) Set the maximum impulse response length in seconds (default 8.0). Affects newly created reverbs only. Lower values reduce CPU cost; higher values allow longer reverb tails. The IR is capped at ``min(decayTime * 1.5, max_ir)``. :Arguments: * **seconds** : float .. _function-audio_conv_reverb_uninit_ConvolutionReverb_q_: .. das:function:: conv_reverb_uninit(reverb: ConvolutionReverb?) Release all resources (FFT workspace, arena buffers) owned by the convolution reverb. Must be called before deleting the reverb object. :Arguments: * **reverb** : :ref:`ConvolutionReverb `? implicit ++++++ Chorus ++++++ * :ref:`chorus_config_default () : ma_chorus_config ` * :ref:`chorus_init (chorus: ma_chorus?; sample_rate: float) ` * :ref:`chorus_process (chorus: ma_chorus?; input: float?; output: float?; nSamples: int) ` * :ref:`chorus_set_config (chorus: ma_chorus?; config: ma_chorus_config) ` .. _function-audio_chorus_config_default: .. das:function:: chorus_config_default() : ma_chorus_config Get the default chorus configuration. .. _function-audio_chorus_init_ma_chorus_q__float: .. das:function:: chorus_init(chorus: ma_chorus?; sample_rate: float) Initialize a 4-tap stereo chorus processor at the given sample rate. :Arguments: * **chorus** : :ref:`ma_chorus `? implicit * **sample_rate** : float .. _function-audio_chorus_process_ma_chorus_q__float_q__float_q__int: .. das:function:: chorus_process(chorus: ma_chorus?; input: float?; output: float?; nSamples: int) Process stereo audio through the chorus effect. :Arguments: * **chorus** : :ref:`ma_chorus `? implicit * **input** : float? implicit * **output** : float? implicit * **nSamples** : int .. _function-audio_chorus_set_config_ma_chorus_q__ma_chorus_config: .. das:function:: chorus_set_config(chorus: ma_chorus?; config: ma_chorus_config) Update chorus parameters (rate, depth, feedback, delay, wet mix). :Arguments: * **chorus** : :ref:`ma_chorus `? implicit * **config** : :ref:`ma_chorus_config ` implicit +++++ Delay +++++ * :ref:`delay_init (delay: ma_delay?; sample_rate: int; delay_time_sec: float; feedback: float) ` * :ref:`delay_process (delay: ma_delay?; input: float?; output: float?; nFrames: int) ` * :ref:`delay_set_params (delay: ma_delay?; sample_rate: int; delay_time_sec: float; feedback: float) ` * :ref:`delay_uninit (delay: ma_delay?) ` .. _function-audio_delay_init_ma_delay_q__int_float_float: .. das:function:: delay_init(delay: ma_delay?; sample_rate: int; delay_time_sec: float; feedback: float) Initialize a stereo delay effect with the given sample rate, delay time in seconds, and feedback (decay) amount, allocating the internal ring buffer. :Arguments: * **delay** : :ref:`ma_delay `? implicit * **sample_rate** : int * **delay_time_sec** : float * **feedback** : float .. _function-audio_delay_process_ma_delay_q__float_q__float_q__int: .. das:function:: delay_process(delay: ma_delay?; input: float?; output: float?; nFrames: int) Process interleaved stereo frames through the delay effect, reading from the input buffer and writing the wet/dry mixed result to the output buffer for the specified number of frames. :Arguments: * **delay** : :ref:`ma_delay `? implicit * **input** : float? implicit * **output** : float? implicit * **nFrames** : int .. _function-audio_delay_set_params_ma_delay_q__int_float_float: .. das:function:: delay_set_params(delay: ma_delay?; sample_rate: int; delay_time_sec: float; feedback: float) Reinitialize the delay effect with a new delay time and feedback amount, freeing and reallocating the internal ring buffer to match the updated parameters. :Arguments: * **delay** : :ref:`ma_delay `? implicit * **sample_rate** : int * **delay_time_sec** : float * **feedback** : float .. _function-audio_delay_uninit_ma_delay_q_: .. das:function:: delay_uninit(delay: ma_delay?) Free the internal ring buffer and resources of a delay effect, releasing all memory allocated by delay_init. :Arguments: * **delay** : :ref:`ma_delay `? implicit +++++++++ SF2 voice +++++++++ * :ref:`ma_sf2_biquad_setup (bq: ma_sf2_biquad?; fc_normalized: float) ` * :ref:`ma_sf2_biquad_setup_hpf (bq: ma_sf2_biquad?; fc_normalized: float) ` * :ref:`ma_sf2_biquad_tick (bq: ma_sf2_biquad?; input: float) : float ` * :ref:`ma_sf2_envelope_init (env: ma_sf2_envelope?) ` * :ref:`ma_sf2_envelope_start (env: ma_sf2_envelope?; sample_rate: float) ` * :ref:`ma_sf2_voice_end_quick (voice: ma_sf2_voice?) ` * :ref:`ma_sf2_voice_init (voice: ma_sf2_voice?; sample_rate: float) ` * :ref:`ma_sf2_voice_is_finished (voice: ma_sf2_voice const?) : int ` * :ref:`ma_sf2_voice_note_off (voice: ma_sf2_voice?) ` * :ref:`ma_sf2_voice_render (voice: ma_sf2_voice?; sample_data: int16 const?; sample_data_len: int; output: float?; output_offset: int; frame_count: int) ` * :ref:`ma_sf2_voice_render_send (voice: ma_sf2_voice?; sample_data: int16 const?; sample_data_len: int; dry_output: float?; reverb_output: float?; output_offset: int; frame_count: int; dry_gain: float; wet_gain: float) ` * :ref:`ma_sf2_voice_render_send2 (voice: ma_sf2_voice?; sample_data: int16 const?; sample_data_len: int; dry_output: float?; reverb_output: float?; chorus_output: float?; output_offset: int; frame_count: int; dry_gain: float; reverb_gain: float; chorus_gain: float) ` * :ref:`ma_sf2_voice_render_send3 (voice: ma_sf2_voice?; sample_data: int16 const?; sample_data_len: int; dry_output: float?; reverb_output: float?; chorus_output: float?; delay_output: float?; output_offset: int; frame_count: int; dry_gain: float; reverb_gain: float; chorus_gain: float; delay_gain: float) ` .. _function-audio_ma_sf2_biquad_setup_ma_sf2_biquad_q__float: .. das:function:: ma_sf2_biquad_setup(bq: ma_sf2_biquad?; fc_normalized: float) Configure the SF2 biquad filter at the given sample rate. :Arguments: * **bq** : :ref:`ma_sf2_biquad `? implicit * **fc_normalized** : float .. _function-audio_ma_sf2_biquad_setup_hpf_ma_sf2_biquad_q__float: .. das:function:: ma_sf2_biquad_setup_hpf(bq: ma_sf2_biquad?; fc_normalized: float) Configure the SF2 biquad filter as a high-pass filter at the given normalized cutoff frequency (0.0 to 0.5 of sample rate). :Arguments: * **bq** : :ref:`ma_sf2_biquad `? implicit * **fc_normalized** : float .. _function-audio_ma_sf2_biquad_tick_ma_sf2_biquad_q__float: .. das:function:: ma_sf2_biquad_tick(bq: ma_sf2_biquad?; input: float) : float Process one sample through the SF2 biquad filter and return the filtered output value. :Arguments: * **bq** : :ref:`ma_sf2_biquad `? implicit * **input** : float .. _function-audio_ma_sf2_envelope_init_ma_sf2_envelope_q_: .. das:function:: ma_sf2_envelope_init(env: ma_sf2_envelope?) Initialize an SF2 ADSR envelope to default state. :Arguments: * **env** : :ref:`ma_sf2_envelope `? implicit .. _function-audio_ma_sf2_envelope_start_ma_sf2_envelope_q__float: .. das:function:: ma_sf2_envelope_start(env: ma_sf2_envelope?; sample_rate: float) Start the envelope at the given sample rate. :Arguments: * **env** : :ref:`ma_sf2_envelope `? implicit * **sample_rate** : float .. _function-audio_ma_sf2_voice_end_quick_ma_sf2_voice_q_: .. das:function:: ma_sf2_voice_end_quick(voice: ma_sf2_voice?) Immediately end the voice with a fast fade-out. :Arguments: * **voice** : :ref:`ma_sf2_voice `? implicit .. _function-audio_ma_sf2_voice_init_ma_sf2_voice_q__float: .. das:function:: ma_sf2_voice_init(voice: ma_sf2_voice?; sample_rate: float) Initialize an SF2 voice at the given sample rate. :Arguments: * **voice** : :ref:`ma_sf2_voice `? implicit * **sample_rate** : float .. _function-audio_ma_sf2_voice_is_finished_ma_sf2_voice_const_q_: .. das:function:: ma_sf2_voice_is_finished(voice: ma_sf2_voice const?) : int Check if the voice has finished playing (all envelopes completed). :Arguments: * **voice** : :ref:`ma_sf2_voice `? implicit .. _function-audio_ma_sf2_voice_note_off_ma_sf2_voice_q_: .. das:function:: ma_sf2_voice_note_off(voice: ma_sf2_voice?) Trigger note-off, starting the release phase of all envelopes. :Arguments: * **voice** : :ref:`ma_sf2_voice `? implicit .. _function-audio_ma_sf2_voice_render_ma_sf2_voice_q__int16_const_q__int_float_q__int_int: .. das:function:: ma_sf2_voice_render(voice: ma_sf2_voice?; sample_data: int16 const?; sample_data_len: int; output: float?; output_offset: int; frame_count: int) Render PCM frames from the voice into an output buffer. :Arguments: * **voice** : :ref:`ma_sf2_voice `? implicit * **sample_data** : int16? implicit * **sample_data_len** : int * **output** : float? implicit * **output_offset** : int * **frame_count** : int .. _function-audio_ma_sf2_voice_render_send_ma_sf2_voice_q__int16_const_q__int_float_q__float_q__int_int_float_float: .. das:function:: ma_sf2_voice_render_send(voice: ma_sf2_voice?; sample_data: int16 const?; sample_data_len: int; dry_output: float?; reverb_output: float?; output_offset: int; frame_count: int; dry_gain: float; wet_gain: float) Render with reverb send. wet_send controls reverb mix level. :Arguments: * **voice** : :ref:`ma_sf2_voice `? implicit * **sample_data** : int16? implicit * **sample_data_len** : int * **dry_output** : float? implicit * **reverb_output** : float? implicit * **output_offset** : int * **frame_count** : int * **dry_gain** : float * **wet_gain** : float .. _function-audio_ma_sf2_voice_render_send2_ma_sf2_voice_q__int16_const_q__int_float_q__float_q__float_q__int_int_float_float_float: .. das:function:: ma_sf2_voice_render_send2(voice: ma_sf2_voice?; sample_data: int16 const?; sample_data_len: int; dry_output: float?; reverb_output: float?; chorus_output: float?; output_offset: int; frame_count: int; dry_gain: float; reverb_gain: float; chorus_gain: float) Render with reverb and chorus sends. :Arguments: * **voice** : :ref:`ma_sf2_voice `? implicit * **sample_data** : int16? implicit * **sample_data_len** : int * **dry_output** : float? implicit * **reverb_output** : float? implicit * **chorus_output** : float? implicit * **output_offset** : int * **frame_count** : int * **dry_gain** : float * **reverb_gain** : float * **chorus_gain** : float .. _function-audio_ma_sf2_voice_render_send3_ma_sf2_voice_q__int16_const_q__int_float_q__float_q__float_q__float_q__int_int_float_float_float_float: .. das:function:: ma_sf2_voice_render_send3(voice: ma_sf2_voice?; sample_data: int16 const?; sample_data_len: int; dry_output: float?; reverb_output: float?; chorus_output: float?; delay_output: float?; output_offset: int; frame_count: int; dry_gain: float; reverb_gain: float; chorus_gain: float; delay_gain: float) Render SF2 voice samples into four separate output buffers (dry, reverb, chorus, and delay sends) simultaneously, applying the corresponding gain to each send. :Arguments: * **voice** : :ref:`ma_sf2_voice `? implicit * **sample_data** : int16? implicit * **sample_data_len** : int * **dry_output** : float? implicit * **reverb_output** : float? implicit * **chorus_output** : float? implicit * **delay_output** : float? implicit * **output_offset** : int * **frame_count** : int * **dry_gain** : float * **reverb_gain** : float * **chorus_gain** : float * **delay_gain** : float