package vendor:miniaudio
Index
Types (241)
- IMMNotificationClient
- aaudio_allowed_capture_policy
- aaudio_content_type
- aaudio_input_preset
- aaudio_usage
- allocation_callbacks
- async_notification
- async_notification_callbacks
- async_notification_event
- async_notification_poll
- atomic_vec3f
- attenuation_model
- audio_buffer
- audio_buffer_config
- audio_buffer_ref
- backend
- backend_callbacks
- biquad
- biquad_coefficient
- biquad_config
- biquad_node
- biquad_node_config
- bpf
- bpf2
- bpf2_config
- bpf_config
- bpf_node
- bpf_node_config
- channel
- channel_conversion_path
- channel_converter
- channel_converter_config
- channel_mix_mode
- context_command__wasapi
- context_config
- context_type
- data_converter
- data_converter_config
- data_converter_execution_path
- data_source
- data_source_base
- data_source_config
- data_source_get_next_proc
- data_source_node
- data_source_node_config
- data_source_vtable
- decoder
- decoder_config
- decoder_read_proc
- decoder_seek_proc
- decoder_tell_proc
- decoding_backend_config
- decoding_backend_vtable
- default_vfs
- delay
- delay_config
- delay_node
- delay_node_config
- device
- device_config
- device_data_proc
- device_descriptor
- device_id
- device_info
- device_job_thread
- device_job_thread_config
- device_notification
- device_notification_proc
- device_notification_type
- device_state
- device_type
- dither_mode
- duplex_rb
- encoder
- encoder_config
- encoder_init_proc
- encoder_seek_proc
- encoder_uninit_proc
- encoder_write_pcm_frames_proc
- encoder_write_proc
- encoding_format
- engine
- engine_config
- engine_node
- engine_node_config
- engine_node_type
- engine_process_proc
- enum_devices_callback_proc
- event
- fader
- fader_config
- fence
- file_info
- format
- gainer
- gainer_config
- handedness
- handle
- hishelf2
- hishelf2_config
- hishelf_config
- hishelf_node
- hishelf_node_config
- hpf
- hpf1
- hpf1_config
- hpf2
- hpf2_config
- hpf_config
- hpf_node
- hpf_node_config
- ios_session_category
- ios_session_category_option
- job
- job_proc
- job_queue
- job_queue_config
- job_queue_flags
- job_type
- lcg
- linear_resampler
- linear_resampler_config
- log
- log_callback
- log_callback_proc
- log_level
- loshelf2
- loshelf2_config
- loshelf_config
- loshelf_node
- loshelf_node_config
- lpf
- lpf1
- lpf1_config
- lpf2
- lpf2_config
- lpf_config
- lpf_node
- lpf_node_config
- ma_read_proc
- ma_seek_proc
- ma_tell_proc
- mono_expansion_mode
- mutex
- node
- node_base
- node_config
- node_flags
- node_graph
- node_graph_config
- node_input_bus
- node_output_bus
- node_state
- node_vtable
- noise
- noise_config
- noise_type
- notch2
- notch2_config
- notch_config
- notch_node
- notch_node_config
- open_mode_flags
- opensl_recording_preset
- opensl_stream_type
- paged_audio_buffer
- paged_audio_buffer_config
- paged_audio_buffer_data
- paged_audio_buffer_page
- pan_mode
- panner
- panner_config
- pcm_rb
- peak2
- peak2_config
- peak_config
- peak_node
- peak_node_config
- performance_profile
- positioning
- pulsewave
- pulsewave_config
- rb
- resample_algorithm
- resampler
- resampler_config
- resampling_backend
- resampling_backend_vtable
- resource_manager
- resource_manager_config
- resource_manager_data_buffer
- resource_manager_data_buffer_node
- resource_manager_data_source
- resource_manager_data_source_config
- resource_manager_data_source_flags
- resource_manager_data_stream
- resource_manager_data_supply
- resource_manager_data_supply_type
- resource_manager_flags
- resource_manager_job
- resource_manager_job_queue
- resource_manager_job_queue_config
- resource_manager_pipeline_notifications
- resource_manager_pipeline_stage_notification
- result
- seek_origin
- semaphore
- share_mode
- slot_allocator
- slot_allocator_config
- slot_allocator_group
- sound
- sound_config
- sound_end_proc
- sound_flags
- sound_group
- sound_group_config
- sound_inlined
- spatializer
- spatializer_config
- spatializer_listener
- spatializer_listener_config
- spinlock
- splitter_node
- splitter_node_config
- standard_channel_map
- standard_sample_rate
- stop_proc
- stream_format
- stream_layout
- thread
- thread_priority
- timer
- vec3f
- vfs
- vfs_callbacks
- vfs_file
- wasapi_usage
- waveform
- waveform_config
- waveform_type
Constants (41)
- BACKEND_COUNT
- BINDINGS_VERSION
- BINDINGS_VERSION_MAJOR
- BINDINGS_VERSION_MINOR
- BINDINGS_VERSION_REVISION
- BINDINGS_VERSION_STRING
- CHANNEL_INDEX_NULL
- DATA_FORMAT_FLAG_EXCLUSIVE_MODE
- DATA_SOURCE_SELF_MANAGED_RANGE_AND_LOOP_POINT
- ENGINE_MAX_LISTENERS
- JOB_TYPE_RESOURCE_MANAGER_QUEUE_FLAG_NON_BLOCKING
- LISTENER_INDEX_CLOSEST
- MAX_CHANNELS
- MAX_DEVICE_NAME_LENGTH
- MAX_FILTER_ORDER
- MAX_LOG_CALLBACKS
- MAX_NODE_BUS_COUNT
- MAX_NODE_LOCAL_BUS_COUNT
- MINIAUDIO_SHARED
- MIN_CHANNELS
- NODE_BUS_COUNT_UNKNOWN
- NO_THREADING
- RESOURCE_MANAGER_MAX_JOB_THREAD_COUNT
- SIMD_ALIGNMENT
- SOUND_SOURCE_CHANNEL_COUNT
- SUPPORT_AAUDIO
- SUPPORT_ALSA
- SUPPORT_AUDIO4
- SUPPORT_COREAUDIO
- SUPPORT_CUSTOM
- SUPPORT_DSOUND
- SUPPORT_JACK
- SUPPORT_NULL
- SUPPORT_OPENSL
- SUPPORT_OSS
- SUPPORT_PULSEAUDIO
- SUPPORT_SNDIO
- SUPPORT_WASAPI
- SUPPORT_WEBAUDIO
- SUPPORT_WINMM
- USE_EXPERIMENTAL_LOCK_FREE_JOB_QUEUE
Variables (0)
This section is empty.
Procedures (930)
- aligned_free
- aligned_malloc
- apply_volume_factor_f32
- apply_volume_factor_pcm_frames
- apply_volume_factor_pcm_frames_f32
- apply_volume_factor_pcm_frames_s16
- apply_volume_factor_pcm_frames_s24
- apply_volume_factor_pcm_frames_s32
- apply_volume_factor_pcm_frames_u8
- apply_volume_factor_s16
- apply_volume_factor_s24
- apply_volume_factor_s32
- apply_volume_factor_u8
- async_notification_event_init
- async_notification_event_signal
- async_notification_event_uninit
- async_notification_event_wait
- async_notification_poll_init
- async_notification_poll_is_signalled
- async_notification_signal
- audio_buffer_alloc_and_init
- audio_buffer_at_end
- audio_buffer_config_init
- audio_buffer_get_available_frames
- audio_buffer_get_cursor_in_pcm_frames
- audio_buffer_get_length_in_pcm_frames
- audio_buffer_init
- audio_buffer_init_copy
- audio_buffer_map
- audio_buffer_read_pcm_frames
- audio_buffer_ref_at_end
- audio_buffer_ref_get_available_frames
- audio_buffer_ref_get_cursor_in_pcm_frames
- audio_buffer_ref_get_length_in_pcm_frames
- audio_buffer_ref_init
- audio_buffer_ref_map
- audio_buffer_ref_read_pcm_frames
- audio_buffer_ref_seek_to_pcm_frame
- audio_buffer_ref_set_data
- audio_buffer_ref_uninit
- audio_buffer_ref_unmap
- audio_buffer_seek_to_pcm_frame
- audio_buffer_uninit
- audio_buffer_uninit_and_free
- audio_buffer_unmap
- biquad_clear_cache
- biquad_config_init
- biquad_get_heap_size
- biquad_get_latency
- biquad_init
- biquad_init_preallocated
- biquad_node_config_init
- biquad_node_init
- biquad_node_reinit
- biquad_node_uninit
- biquad_process_pcm_frames
- biquad_reinit
- biquad_uninit
- blend_f32
- bpf2_config_init
- bpf2_get_heap_size
- bpf2_get_latency
- bpf2_init
- bpf2_init_preallocated
- bpf2_process_pcm_frames
- bpf2_reinit
- bpf2_uninit
- bpf_config_init
- bpf_get_heap_size
- bpf_get_latency
- bpf_init
- bpf_init_preallocated
- bpf_node_config_init
- bpf_node_init
- bpf_node_reinit
- bpf_node_uninit
- bpf_process_pcm_frames
- bpf_reinit
- bpf_uninit
- calculate_buffer_size_in_frames_from_descriptor
- calculate_buffer_size_in_frames_from_milliseconds
- calculate_buffer_size_in_milliseconds_from_frames
- calloc
- channel_converter_config_init
- channel_converter_get_heap_size
- channel_converter_get_input_channel_map
- channel_converter_get_output_channel_map
- channel_converter_init
- channel_converter_init_preallocated
- channel_converter_process_pcm_frames
- channel_converter_uninit
- channel_map_contains_channel_position
- channel_map_copy
- channel_map_copy_or_default
- channel_map_find_channel_position
- channel_map_get_channel
- channel_map_init_blank
- channel_map_init_standard
- channel_map_is_blank
- channel_map_is_equal
- channel_map_is_valid
- channel_map_to_string
- channel_position_to_string
- clip_pcm_frames
- clip_samples_f32
- clip_samples_s16
- clip_samples_s24
- clip_samples_s32
- clip_samples_u8
- context_config_init
- context_enumerate_devices
- context_get_device_info
- context_get_devices
- context_get_log
- context_init
- context_is_loopback_supported
- context_sizeof
- context_uninit
- convert_frames
- convert_frames_ex
- convert_pcm_frames_format
- copy_and_apply_volume_factor_f32
- copy_and_apply_volume_factor_pcm_frames
- copy_and_apply_volume_factor_pcm_frames_f32
- copy_and_apply_volume_factor_pcm_frames_s16
- copy_and_apply_volume_factor_pcm_frames_s24
- copy_and_apply_volume_factor_pcm_frames_s32
- copy_and_apply_volume_factor_pcm_frames_u8
- copy_and_apply_volume_factor_per_channel_f32
- copy_and_apply_volume_factor_s16
- copy_and_apply_volume_factor_s24
- copy_and_apply_volume_factor_s32
- copy_and_apply_volume_factor_u8
- copy_pcm_frames
- data_converter_config_init
- data_converter_config_init_default
- data_converter_get_expected_output_frame_count
- data_converter_get_heap_size
- data_converter_get_input_channel_map
- data_converter_get_input_latency
- data_converter_get_output_channel_map
- data_converter_get_output_latency
- data_converter_get_required_input_frame_count
- data_converter_init
- data_converter_init_preallocated
- data_converter_process_pcm_frames
- data_converter_reset
- data_converter_set_rate
- data_converter_set_rate_ratio
- data_converter_uninit
- data_source_config_init
- data_source_get_current
- data_source_get_cursor_in_pcm_frames
- data_source_get_cursor_in_seconds
- data_source_get_data_format
- data_source_get_length_in_pcm_frames
- data_source_get_length_in_seconds
- data_source_get_loop_point_in_pcm_frames
- data_source_get_next
- data_source_get_next_callback
- data_source_get_range_in_pcm_frames
- data_source_init
- data_source_is_looping
- data_source_node_config_init
- data_source_node_init
- data_source_node_is_looping
- data_source_node_set_looping
- data_source_node_uninit
- data_source_read_pcm_frames
- data_source_seek_pcm_frames
- data_source_seek_to_pcm_frame
- data_source_set_current
- data_source_set_loop_point_in_pcm_frames
- data_source_set_looping
- data_source_set_next
- data_source_set_next_callback
- data_source_set_range_in_pcm_frames
- data_source_uninit
- decode_file
- decode_from_vfs
- decode_memory
- decoder_config_init
- decoder_config_init_default
- decoder_get_available_frames
- decoder_get_cursor_in_pcm_frames
- decoder_get_data_format
- decoder_get_length_in_pcm_frames
- decoder_init
- decoder_init_file
- decoder_init_file_w
- decoder_init_memory
- decoder_init_vfs
- decoder_init_vfs_w
- decoder_read_pcm_frames
- decoder_seek_to_pcm_frame
- decoder_uninit
- decoding_backend_config_init
- default_vfs_init
- deinterleave_pcm_frames
- delay_config_init
- delay_get_decay
- delay_get_dry
- delay_get_wet
- delay_init
- delay_node_config_init
- delay_node_get_decay
- delay_node_get_dry
- delay_node_get_wet
- delay_node_init
- delay_node_set_decay
- delay_node_set_dry
- delay_node_set_wet
- delay_node_uninit
- delay_process_pcm_frames
- delay_set_decay
- delay_set_dry
- delay_set_wet
- delay_uninit
- device_config_init
- device_get_context
- device_get_info
- device_get_log
- device_get_master_volume
- device_get_master_volume_db
- device_get_name
- device_get_state
- device_handle_backend_data_callback
- device_init
- device_init_ex
- device_is_started
- device_job_thread_config_init
- device_job_thread_init
- device_job_thread_next
- device_job_thread_post
- device_job_thread_uninit
- device_post_init
- device_set_master_volume
- device_set_master_volume_db
- device_start
- device_stop
- device_uninit
- duplex_rb_init
- duplex_rb_uninit
- encoder_config_init
- encoder_init
- encoder_init_file
- encoder_init_file_w
- encoder_init_vfs
- encoder_init_vfs_w
- encoder_uninit
- encoder_write_pcm_frames
- engine_config_init
- engine_find_closest_listener
- engine_get_channels
- engine_get_device
- engine_get_endpoint
- engine_get_gain_db
- engine_get_listener_count
- engine_get_log
- engine_get_node_graph
- engine_get_resource_manager
- engine_get_sample_rate
- engine_get_time
- engine_get_time_in_milliseconds
- engine_get_time_in_pcm_frames
- engine_get_volume
- engine_init
- engine_listener_get_cone
- engine_listener_get_direction
- engine_listener_get_position
- engine_listener_get_velocity
- engine_listener_get_world_up
- engine_listener_is_enabled
- engine_listener_set_cone
- engine_listener_set_direction
- engine_listener_set_enabled
- engine_listener_set_position
- engine_listener_set_velocity
- engine_listener_set_world_up
- engine_node_config_init
- engine_node_get_heap_size
- engine_node_init
- engine_node_init_preallocated
- engine_node_uninit
- engine_play_sound
- engine_play_sound_ex
- engine_read_pcm_frames
- engine_set_gain_db
- engine_set_time
- engine_set_time_in_milliseconds
- engine_set_time_in_pcm_frames
- engine_set_volume
- engine_start
- engine_stop
- engine_uninit
- event_init
- event_signal
- event_uninit
- event_wait
- fader_config_init
- fader_get_current_volume
- fader_get_data_format
- fader_init
- fader_process_pcm_frames
- fader_set_fade
- fader_set_fade_ex
- fence_acquire
- fence_init
- fence_release
- fence_uninit
- fence_wait
- free
- gainer_config_init
- gainer_get_heap_size
- gainer_get_master_volume
- gainer_init
- gainer_init_preallocated
- gainer_process_pcm_frames
- gainer_set_gain
- gainer_set_gains
- gainer_set_master_volume
- gainer_uninit
- get_backend_from_name
- get_backend_name
- get_bytes_per_frame
- get_bytes_per_sample
- get_enabled_backends
- get_format_name
- hishelf2_config_init
- hishelf2_get_heap_size
- hishelf2_get_latency
- hishelf2_init
- hishelf2_init_preallocated
- hishelf2_process_pcm_frames
- hishelf2_reinit
- hishelf2_uninit
- hishelf_node_config_init
- hishelf_node_init
- hishelf_node_reinit
- hishelf_node_uninit
- hpf1_config_init
- hpf1_get_heap_size
- hpf1_get_latency
- hpf1_init
- hpf1_init_preallocated
- hpf1_process_pcm_frames
- hpf1_reinit
- hpf1_uninit
- hpf2_config_init
- hpf2_get_heap_size
- hpf2_get_latency
- hpf2_init
- hpf2_init_preallocated
- hpf2_process_pcm_frames
- hpf2_reinit
- hpf2_uninit
- hpf_config_init
- hpf_get_heap_size
- hpf_get_latency
- hpf_init
- hpf_init_preallocated
- hpf_node_config_init
- hpf_node_init
- hpf_node_reinit
- hpf_node_uninit
- hpf_process_pcm_frames
- hpf_reinit
- hpf_uninit
- interleave_pcm_frames
- is_backend_enabled
- is_loopback_supported
- job_init
- job_process
- job_queue_config_init
- job_queue_get_heap_size
- job_queue_init
- job_queue_init_preallocated
- job_queue_next
- job_queue_post
- job_queue_uninit
- linear_resampler_config_init
- linear_resampler_get_expected_output_frame_count
- linear_resampler_get_heap_size
- linear_resampler_get_input_latency
- linear_resampler_get_output_latency
- linear_resampler_get_required_input_frame_count
- linear_resampler_init
- linear_resampler_init_preallocated
- linear_resampler_process_pcm_frames
- linear_resampler_reset
- linear_resampler_set_rate
- linear_resampler_set_rate_ratio
- linear_resampler_uninit
- log_callback_init
- log_init
- log_level_to_string
- log_post
- log_postf
- log_postv
- log_register_callback
- log_uninit
- log_unregister_callback
- loshelf2_config_init
- loshelf2_get_heap_size
- loshelf2_get_latency
- loshelf2_init
- loshelf2_init_preallocated
- loshelf2_process_pcm_frames
- loshelf2_reinit
- loshelf2_uninit
- loshelf_node_config_init
- loshelf_node_init
- loshelf_node_reinit
- loshelf_node_uninit
- lpf1_clear_cache
- lpf1_config_init
- lpf1_get_heap_size
- lpf1_get_latency
- lpf1_init
- lpf1_init_preallocated
- lpf1_process_pcm_frames
- lpf1_reinit
- lpf1_uninit
- lpf2_clear_cache
- lpf2_config_init
- lpf2_get_heap_size
- lpf2_get_latency
- lpf2_init
- lpf2_init_preallocated
- lpf2_process_pcm_frames
- lpf2_reinit
- lpf2_uninit
- lpf_clear_cache
- lpf_config_init
- lpf_get_heap_size
- lpf_get_latency
- lpf_init
- lpf_init_preallocated
- lpf_node_config_init
- lpf_node_init
- lpf_node_reinit
- lpf_node_uninit
- lpf_process_pcm_frames
- lpf_reinit
- lpf_uninit
- ma_copy_and_apply_volume_and_clip_pcm_frames
- ma_copy_and_apply_volume_and_clip_samples_f32
- ma_copy_and_apply_volume_and_clip_samples_s16
- ma_copy_and_apply_volume_and_clip_samples_s24
- ma_copy_and_apply_volume_and_clip_samples_s32
- ma_copy_and_apply_volume_and_clip_samples_u8
- ma_mix_pcm_frames_f32
- malloc
- mutex_init
- mutex_lock
- mutex_uninit
- mutex_unlock
- node_attach_output_bus
- node_config_init
- node_detach_all_output_buses
- node_detach_output_bus
- node_get_heap_size
- node_get_input_bus_count
- node_get_input_channels
- node_get_node_graph
- node_get_output_bus_count
- node_get_output_bus_volume
- node_get_output_channels
- node_get_state
- node_get_state_by_time
- node_get_state_by_time_range
- node_get_state_time
- node_get_time
- node_graph_config_init
- node_graph_get_channels
- node_graph_get_endpoint
- node_graph_get_time
- node_graph_init
- node_graph_read_pcm_frames
- node_graph_set_time
- node_graph_uninit
- node_init
- node_init_preallocated
- node_set_output_bus_volume
- node_set_state
- node_set_state_time
- node_set_time
- node_uninit
- noise_config_init
- noise_get_heap_size
- noise_init
- noise_init_preallocated
- noise_read_pcm_frames
- noise_set_amplitude
- noise_set_seed
- noise_set_type
- noise_uninit
- notch2_config_init
- notch2_get_heap_size
- notch2_get_latency
- notch2_init
- notch2_init_preallocated
- notch2_process_pcm_frames
- notch2_reinit
- notch2_uninit
- notch_node_config_init
- notch_node_init
- notch_node_reinit
- notch_node_uninit
- offset_pcm_frames_const_ptr
- offset_pcm_frames_const_ptr_f32
- offset_pcm_frames_ptr
- offset_pcm_frames_ptr_f32
- paged_audio_buffer_config_init
- paged_audio_buffer_data_allocate_and_append_page
- paged_audio_buffer_data_allocate_page
- paged_audio_buffer_data_append_page
- paged_audio_buffer_data_free_page
- paged_audio_buffer_data_get_head
- paged_audio_buffer_data_get_length_in_pcm_frames
- paged_audio_buffer_data_get_tail
- paged_audio_buffer_data_init
- paged_audio_buffer_data_uninit
- paged_audio_buffer_get_cursor_in_pcm_frames
- paged_audio_buffer_get_length_in_pcm_frames
- paged_audio_buffer_init
- paged_audio_buffer_read_pcm_frames
- paged_audio_buffer_seek_to_pcm_frame
- paged_audio_buffer_uninit
- panner_config_init
- panner_get_mode
- panner_get_pan
- panner_init
- panner_process_pcm_frames
- panner_set_mode
- panner_set_pan
- pcm_convert
- pcm_f32_to_s16
- pcm_f32_to_s24
- pcm_f32_to_s32
- pcm_f32_to_u8
- pcm_rb_acquire_read
- pcm_rb_acquire_write
- pcm_rb_available_read
- pcm_rb_available_write
- pcm_rb_commit_read
- pcm_rb_commit_write
- pcm_rb_get_channels
- pcm_rb_get_format
- pcm_rb_get_sample_rate
- pcm_rb_get_subbuffer_offset
- pcm_rb_get_subbuffer_ptr
- pcm_rb_get_subbuffer_size
- pcm_rb_get_subbuffer_stride
- pcm_rb_init
- pcm_rb_init_ex
- pcm_rb_pointer_distance
- pcm_rb_reset
- pcm_rb_seek_read
- pcm_rb_seek_write
- pcm_rb_set_sample_rate
- pcm_rb_uninit
- pcm_s16_to_f32
- pcm_s16_to_s24
- pcm_s16_to_s32
- pcm_s16_to_u8
- pcm_s24_to_f32
- pcm_s24_to_s16
- pcm_s24_to_s32
- pcm_s24_to_u8
- pcm_s32_to_f32
- pcm_s32_to_s16
- pcm_s32_to_s24
- pcm_s32_to_u8
- pcm_u8_to_f32
- pcm_u8_to_s16
- pcm_u8_to_s24
- pcm_u8_to_s32
- peak2_config_init
- peak2_get_heap_size
- peak2_get_latency
- peak2_init
- peak2_init_preallocated
- peak2_process_pcm_frames
- peak2_reinit
- peak2_uninit
- peak_node_config_init
- peak_node_init
- peak_node_reinit
- peak_node_uninit
- pulsewave_config_init
- pulsewave_init
- pulsewave_read_pcm_frames
- pulsewave_seek_to_pcm_frame
- pulsewave_set_amplitude
- pulsewave_set_duty_cycle
- pulsewave_set_frequency
- pulsewave_set_sample_rate
- pulsewave_uninit
- rb_acquire_read
- rb_acquire_write
- rb_available_read
- rb_available_write
- rb_commit_read
- rb_commit_write
- rb_get_subbuffer_offset
- rb_get_subbuffer_ptr
- rb_get_subbuffer_size
- rb_get_subbuffer_stride
- rb_init
- rb_init_ex
- rb_pointer_distance
- rb_reset
- rb_seek_read
- rb_seek_write
- rb_uninit
- realloc
- resampler_config_init
- resampler_get_expected_output_frame_count
- resampler_get_heap_size
- resampler_get_input_latency
- resampler_get_output_latency
- resampler_get_required_input_frame_count
- resampler_init
- resampler_init_preallocated
- resampler_process_pcm_frames
- resampler_reset
- resampler_set_rate
- resampler_set_rate_ratio
- resampler_uninit
- resource_manager_config_init
- resource_manager_data_buffer_get_available_frames
- resource_manager_data_buffer_get_cursor_in_pcm_frames
- resource_manager_data_buffer_get_data_format
- resource_manager_data_buffer_get_length_in_pcm_frames
- resource_manager_data_buffer_init
- resource_manager_data_buffer_init_copy
- resource_manager_data_buffer_init_ex
- resource_manager_data_buffer_init_w
- resource_manager_data_buffer_is_looping
- resource_manager_data_buffer_read_pcm_frames
- resource_manager_data_buffer_result
- resource_manager_data_buffer_seek_to_pcm_frame
- resource_manager_data_buffer_set_looping
- resource_manager_data_buffer_uninit
- resource_manager_data_source_config_init
- resource_manager_data_source_get_available_frames
- resource_manager_data_source_get_cursor_in_pcm_frames
- resource_manager_data_source_get_data_format
- resource_manager_data_source_get_length_in_pcm_frames
- resource_manager_data_source_init
- resource_manager_data_source_init_copy
- resource_manager_data_source_init_ex
- resource_manager_data_source_init_w
- resource_manager_data_source_is_looping
- resource_manager_data_source_read_pcm_frames
- resource_manager_data_source_result
- resource_manager_data_source_seek_to_pcm_frame
- resource_manager_data_source_set_looping
- resource_manager_data_source_uninit
- resource_manager_data_stream_get_available_frames
- resource_manager_data_stream_get_cursor_in_pcm_frames
- resource_manager_data_stream_get_data_format
- resource_manager_data_stream_get_length_in_pcm_frames
- resource_manager_data_stream_init
- resource_manager_data_stream_init_ex
- resource_manager_data_stream_init_w
- resource_manager_data_stream_is_looping
- resource_manager_data_stream_read_pcm_frames
- resource_manager_data_stream_result
- resource_manager_data_stream_seek_to_pcm_frame
- resource_manager_data_stream_set_looping
- resource_manager_data_stream_uninit
- resource_manager_get_log
- resource_manager_init
- resource_manager_job_init
- resource_manager_job_queue_config_init
- resource_manager_job_queue_get_heap_size
- resource_manager_job_queue_init
- resource_manager_job_queue_init_preallocated
- resource_manager_job_queue_next
- resource_manager_job_queue_post
- resource_manager_job_queue_uninit
- resource_manager_next_job
- resource_manager_pipeline_notifications_init
- resource_manager_post_job
- resource_manager_post_job_quit
- resource_manager_process_job
- resource_manager_process_next_job
- resource_manager_register_decoded_data
- resource_manager_register_decoded_data_w
- resource_manager_register_encoded_data
- resource_manager_register_encoded_data_w
- resource_manager_register_file
- resource_manager_register_file_w
- resource_manager_uninit
- resource_manager_unregister_data
- resource_manager_unregister_data_w
- resource_manager_unregister_file
- resource_manager_unregister_file_w
- result_description
- silence_pcm_frames
- slot_allocator_alloc
- slot_allocator_config_init
- slot_allocator_free
- slot_allocator_get_heap_size
- slot_allocator_init
- slot_allocator_init_preallocated
- slot_allocator_uninit
- sound_at_end
- sound_config_init
- sound_config_init2
- sound_get_attenuation_model
- sound_get_cone
- sound_get_current_fade_volume
- sound_get_cursor_in_pcm_frames
- sound_get_cursor_in_seconds
- sound_get_data_format
- sound_get_data_source
- sound_get_direction
- sound_get_direction_to_listener
- sound_get_directional_attenuation_factor
- sound_get_doppler_factor
- sound_get_engine
- sound_get_length_in_pcm_frames
- sound_get_length_in_seconds
- sound_get_listener_index
- sound_get_max_distance
- sound_get_max_gain
- sound_get_min_distance
- sound_get_min_gain
- sound_get_pan
- sound_get_pan_mode
- sound_get_pinned_listener_index
- sound_get_pitch
- sound_get_position
- sound_get_positioning
- sound_get_rolloff
- sound_get_time_in_milliseconds
- sound_get_time_in_pcm_frames
- sound_get_velocity
- sound_get_volume
- sound_group_config_init
- sound_group_config_init2
- sound_group_get_attenuation_model
- sound_group_get_cone
- sound_group_get_current_fade_volume
- sound_group_get_direction
- sound_group_get_direction_to_listener
- sound_group_get_directional_attenuation_factor
- sound_group_get_doppler_factor
- sound_group_get_engine
- sound_group_get_listener_index
- sound_group_get_max_distance
- sound_group_get_max_gain
- sound_group_get_min_distance
- sound_group_get_min_gain
- sound_group_get_pan
- sound_group_get_pan_mode
- sound_group_get_pinned_listener_index
- sound_group_get_pitch
- sound_group_get_position
- sound_group_get_positioning
- sound_group_get_rolloff
- sound_group_get_time_in_pcm_frames
- sound_group_get_velocity
- sound_group_get_volume
- sound_group_init
- sound_group_init_ex
- sound_group_is_playing
- sound_group_is_spatialization_enabled
- sound_group_set_attenuation_model
- sound_group_set_cone
- sound_group_set_direction
- sound_group_set_directional_attenuation_factor
- sound_group_set_doppler_factor
- sound_group_set_fade_in_milliseconds
- sound_group_set_fade_in_pcm_frames
- sound_group_set_max_distance
- sound_group_set_max_gain
- sound_group_set_min_distance
- sound_group_set_min_gain
- sound_group_set_pan
- sound_group_set_pan_mode
- sound_group_set_pinned_listener_index
- sound_group_set_pitch
- sound_group_set_position
- sound_group_set_positioning
- sound_group_set_rolloff
- sound_group_set_spatialization_enabled
- sound_group_set_start_time_in_milliseconds
- sound_group_set_start_time_in_pcm_frames
- sound_group_set_stop_time_in_milliseconds
- sound_group_set_stop_time_in_pcm_frames
- sound_group_set_velocity
- sound_group_set_volume
- sound_group_start
- sound_group_stop
- sound_group_uninit
- sound_init_copy
- sound_init_ex
- sound_init_from_data_source
- sound_init_from_file
- sound_init_from_file_w
- sound_is_looping
- sound_is_playing
- sound_is_spatialization_enabled
- sound_seek_to_pcm_frame
- sound_set_attenuation_model
- sound_set_cone
- sound_set_direction
- sound_set_directional_attenuation_factor
- sound_set_doppler_factor
- sound_set_end_callback
- sound_set_fade_in_milliseconds
- sound_set_fade_in_pcm_frames
- sound_set_fade_start_in_milliseconds
- sound_set_fade_start_in_pcm_frames
- sound_set_looping
- sound_set_max_distance
- sound_set_max_gain
- sound_set_min_distance
- sound_set_min_gain
- sound_set_pan
- sound_set_pan_mode
- sound_set_pinned_listener_index
- sound_set_pitch
- sound_set_position
- sound_set_positioning
- sound_set_rolloff
- sound_set_spatialization_enabled
- sound_set_start_time_in_milliseconds
- sound_set_start_time_in_pcm_frames
- sound_set_stop_time_in_milliseconds
- sound_set_stop_time_in_pcm_frames
- sound_set_stop_time_with_fade_in_milliseconds
- sound_set_stop_time_with_fade_in_pcm_frames
- sound_set_velocity
- sound_set_volume
- sound_start
- sound_stop
- sound_stop_with_fade_in_milliseconds
- sound_stop_with_fade_in_pcm_frames
- sound_uninit
- spatializer_config_init
- spatializer_get_attenuation_model
- spatializer_get_cone
- spatializer_get_direction
- spatializer_get_directional_attenuation_factor
- spatializer_get_doppler_factor
- spatializer_get_heap_size
- spatializer_get_input_channels
- spatializer_get_master_volume
- spatializer_get_max_distance
- spatializer_get_max_gain
- spatializer_get_min_distance
- spatializer_get_min_gain
- spatializer_get_output_channels
- spatializer_get_position
- spatializer_get_positioning
- spatializer_get_relative_position_and_direction
- spatializer_get_rolloff
- spatializer_get_velocity
- spatializer_init
- spatializer_init_preallocated
- spatializer_listener_config_init
- spatializer_listener_get_channel_map
- spatializer_listener_get_cone
- spatializer_listener_get_direction
- spatializer_listener_get_heap_size
- spatializer_listener_get_position
- spatializer_listener_get_speed_of_sound
- spatializer_listener_get_velocity
- spatializer_listener_get_world_up
- spatializer_listener_init
- spatializer_listener_init_preallocated
- spatializer_listener_is_enabled
- spatializer_listener_set_cone
- spatializer_listener_set_direction
- spatializer_listener_set_enabled
- spatializer_listener_set_position
- spatializer_listener_set_speed_of_sound
- spatializer_listener_set_velocity
- spatializer_listener_set_world_up
- spatializer_listener_uninit
- spatializer_process_pcm_frames
- spatializer_set_attenuation_model
- spatializer_set_cone
- spatializer_set_direction
- spatializer_set_directional_attenuation_factor
- spatializer_set_doppler_factor
- spatializer_set_master_volume
- spatializer_set_max_distance
- spatializer_set_max_gain
- spatializer_set_min_distance
- spatializer_set_min_gain
- spatializer_set_position
- spatializer_set_positioning
- spatializer_set_rolloff
- spatializer_set_velocity
- spatializer_uninit
- spinlock_lock
- spinlock_lock_noyield
- spinlock_unlock
- splitter_node_config_init
- splitter_node_init
- splitter_node_uninit
- version
- version_check
- version_string
- vfs_close
- vfs_info
- vfs_open
- vfs_open_and_read_file
- vfs_open_w
- vfs_read
- vfs_seek
- vfs_tell
- vfs_write
- volume_db_to_linear
- volume_linear_to_db
- waveform_config_init
- waveform_init
- waveform_read_pcm_frames
- waveform_seek_to_pcm_frame
- waveform_set_amplitude
- waveform_set_frequency
- waveform_set_sample_rate
- waveform_set_type
- waveform_uninit
Procedure Groups (0)
This section is empty.
Types
aaudio_allowed_capture_policy ¶
aaudio_allowed_capture_policy :: enum i32 { default = 0, // Leaves the allowed capture policy unset. all, // AAUDIO_ALLOW_CAPTURE_BY_ALL system, // AAUDIO_ALLOW_CAPTURE_BY_SYSTEM none, // AAUDIO_ALLOW_CAPTURE_BY_NONE }
aaudio_content_type ¶
aaudio_content_type :: enum i32 { default = 0, // Leaves the content type unset. speech, // AAUDIO_CONTENT_TYPE_SPEECH music, // AAUDIO_CONTENT_TYPE_MUSIC movie, // AAUDIO_CONTENT_TYPE_MOVIE sonification, // AAUDIO_CONTENT_TYPE_SONIFICATION }
AAudio content types.
aaudio_input_preset ¶
aaudio_input_preset :: enum i32 { default = 0, // Leaves the input preset unset. generic, // AAUDIO_INPUT_PRESET_GENERIC camcorder, // AAUDIO_INPUT_PRESET_CAMCORDER voice_recognition, // AAUDIO_INPUT_PRESET_VOICE_RECOGNITION voice_communication, // AAUDIO_INPUT_PRESET_VOICE_COMMUNICATION unprocessed, // AAUDIO_INPUT_PRESET_UNPROCESSED voice_performance, // AAUDIO_INPUT_PRESET_VOICE_PERFORMANCE }
AAudio input presets.
aaudio_usage ¶
aaudio_usage :: enum i32 { default = 0, // Leaves the usage type unset. media, // AAUDIO_USAGE_MEDIA voice_communication, // AAUDIO_USAGE_VOICE_COMMUNICATION voice_communication_signalling, // AAUDIO_USAGE_VOICE_COMMUNICATION_SIGNALLING alarm, // AAUDIO_USAGE_ALARM notification, // AAUDIO_USAGE_NOTIFICATION notification_ringtone, // AAUDIO_USAGE_NOTIFICATION_RINGTONE notification_event, // AAUDIO_USAGE_NOTIFICATION_EVENT assistance_accessibility, // AAUDIO_USAGE_ASSISTANCE_ACCESSIBILITY assistance_navigation_guidance, // AAUDIO_USAGE_ASSISTANCE_NAVIGATION_GUIDANCE assistance_sonification, // AAUDIO_USAGE_ASSISTANCE_SONIFICATION game, // AAUDIO_USAGE_GAME assitant, // AAUDIO_USAGE_ASSISTANT emergency, // AAUDIO_SYSTEM_USAGE_EMERGENCY safety, // AAUDIO_SYSTEM_USAGE_SAFETY vehicle_status, // AAUDIO_SYSTEM_USAGE_VEHICLE_STATUS announcement, // AAUDIO_SYSTEM_USAGE_ANNOUNCEMENT }
AAudio usage types.
allocation_callbacks ¶
allocation_callbacks :: struct { pUserData: rawptr, onMalloc: proc "c" (sz: uint, pUserData: rawptr) -> rawptr, onRealloc: proc "c" (p: rawptr, sz: uint, pUserData: rawptr) -> rawptr, onFree: proc "c" (p: rawptr, pUserData: rawptr), }
Related Procedures With Parameters
- aligned_free
- aligned_malloc
- audio_buffer_config_init
- biquad_init
- biquad_node_init
- biquad_node_uninit
- biquad_uninit
- bpf2_init
- bpf2_uninit
- bpf_init
- bpf_node_init
- bpf_node_uninit
- bpf_uninit
- calloc
- channel_converter_init
- channel_converter_uninit
- data_converter_init
- data_converter_uninit
- data_source_node_init
- data_source_node_uninit
- default_vfs_init
- delay_init
- delay_node_init
- delay_node_uninit
- delay_uninit
- device_job_thread_init
- device_job_thread_uninit
- duplex_rb_init
- engine_node_init
- engine_node_uninit
- free
- gainer_init
- gainer_uninit
- hishelf2_init
- hishelf2_uninit
- hishelf_node_init
- hishelf_node_uninit
- hpf1_init
- hpf1_uninit
- hpf2_init
- hpf2_uninit
- hpf_init
- hpf_node_init
- hpf_node_uninit
- hpf_uninit
- job_queue_init
- job_queue_uninit
- linear_resampler_init
- linear_resampler_uninit
- log_init
- loshelf2_init
- loshelf2_uninit
- loshelf_node_init
- loshelf_node_uninit
- lpf1_init
- lpf1_uninit
- lpf2_init
- lpf2_uninit
- lpf_init
- lpf_node_init
- lpf_node_uninit
- lpf_uninit
- malloc
- node_graph_init
- node_graph_uninit
- node_init
- node_uninit
- noise_init
- noise_uninit
- notch2_init
- notch2_uninit
- notch_node_init
- notch_node_uninit
- paged_audio_buffer_data_allocate_and_append_page
- paged_audio_buffer_data_allocate_page
- paged_audio_buffer_data_free_page
- paged_audio_buffer_data_uninit
- pcm_rb_init
- pcm_rb_init_ex
- peak2_init
- peak2_uninit
- peak_node_init
- peak_node_uninit
- rb_init
- rb_init_ex
- realloc
- resampler_init
- resampler_uninit
- slot_allocator_init
- slot_allocator_uninit
- spatializer_init
- spatializer_listener_init
- spatializer_listener_uninit
- spatializer_uninit
- splitter_node_init
- splitter_node_uninit
- vfs_open_and_read_file
async_notification ¶
async_notification :: struct {}
Notification callback for asynchronous operations.
Related Procedures With Parameters
async_notification_callbacks ¶
async_notification_callbacks :: struct { onSignal: proc "c" (pNotification: ^async_notification), }
async_notification_event ¶
async_notification_event :: struct { cb: async_notification_callbacks, e: event, }
Event Notification
This uses an ma_event. If threading is disabled (MA_NO_THREADING), initialization will fail.
Related Procedures With Parameters
async_notification_poll ¶
async_notification_poll :: struct { cb: async_notification_callbacks, signalled: b32, }
Simple polling notification.
This just sets a variable when the notification has been signalled which is then polled with ma_async_notification_poll_is_signalled()
Related Procedures With Parameters
attenuation_model ¶
attenuation_model :: enum i32 { none, // No distance attenuation and no spatialization. inverse, // Equivalent to OpenAL's AL_INVERSE_DISTANCE_CLAMPED. linear, // Linear attenuation. Equivalent to OpenAL's AL_LINEAR_DISTANCE_CLAMPED. exponential, // Exponential attenuation. Equivalent to OpenAL's AL_EXPONENT_DISTANCE_CLAMPED. }
Related Procedures With Parameters
Related Procedures With Returns
audio_buffer ¶
audio_buffer :: struct { ref: audio_buffer_ref, allocationCallbacks: allocation_callbacks, ownsData: b32, // Used to control whether or not miniaudio owns the data buffer. If set to true, pData will be freed in ma_audio_buffer_uninit(). _pExtraData: [1]u8, }
Related Procedures With Parameters
- audio_buffer_at_end
- audio_buffer_get_available_frames
- audio_buffer_get_cursor_in_pcm_frames
- audio_buffer_get_length_in_pcm_frames
- audio_buffer_init
- audio_buffer_init_copy
- audio_buffer_map
- audio_buffer_read_pcm_frames
- audio_buffer_seek_to_pcm_frame
- audio_buffer_uninit
- audio_buffer_uninit_and_free
- audio_buffer_unmap
audio_buffer_config ¶
audio_buffer_config :: struct { format: format, channels: u32, sampleRate: u32, sizeInFrames: u64, pData: rawptr, // If set to NULL, will allocate a block of memory for you. allocationCallbacks: allocation_callbacks, }
Related Procedures With Parameters
Related Procedures With Returns
audio_buffer_ref ¶
audio_buffer_ref :: struct { ds: data_source_base, format: format, channels: u32, sampleRate: u32, cursor: u64, sizeInFrames: u64, pData: rawptr, }
Related Procedures With Parameters
- audio_buffer_ref_at_end
- audio_buffer_ref_get_available_frames
- audio_buffer_ref_get_cursor_in_pcm_frames
- audio_buffer_ref_get_length_in_pcm_frames
- audio_buffer_ref_init
- audio_buffer_ref_map
- audio_buffer_ref_read_pcm_frames
- audio_buffer_ref_seek_to_pcm_frame
- audio_buffer_ref_set_data
- audio_buffer_ref_uninit
- audio_buffer_ref_unmap
backend ¶
backend :: enum i32 { wasapi, dsound, winmm, coreaudio, sndio, audio4, oss, pulseaudio, alsa, jack, aaudio, opensl, webaudio, custom, // <-- Custom backend, with callbacks defined by the context config. null, // <-- Must always be the last item. Lowest priority, and used as the terminator for backend enumeration. }
Backend enums must be in priority order.
Related Procedures With Parameters
backend_callbacks ¶
backend_callbacks :: struct { onContextInit: proc "c" (pContext: ^context_type, pConfig: ^context_config, pCallbacks: ^backend_callbacks) -> result, onContextUninit: proc "c" (pContext: ^context_type) -> result, onContextEnumerateDevices: proc "c" (pContext: ^context_type, callback: enum_devices_callback_proc, pUserData: rawptr) -> result, onContextGetDeviceInfo: proc "c" (pContext: ^context_type, deviceType: device_type, pDeviceID: ^device_id, pDeviceInfo: ^device_info) -> result, onDeviceInit: proc "c" (pDevice: ^device, pConfig: ^device_config, pDescriptorPlayback, pDescriptorCapture: ^device_descriptor) -> result, onDeviceUninit: proc "c" (pDevice: ^device) -> result, onDeviceStart: proc "c" (pDevice: ^device) -> result, onDeviceStop: proc "c" (pDevice: ^device) -> result, onDeviceRead: proc "c" (pDevice: ^device, pFrames: rawptr, frameCount: u32, pFramesRead: ^u32) -> result, onDeviceWrite: proc "c" (pDevice: ^device, pFrames: rawptr, frameCount: u32, pFramesWritten: ^u32) -> result, onDeviceDataLoop: proc "c" (pDevice: ^device) -> result, onDeviceDataLoopWakeup: proc "c" (pDevice: ^device) -> result, onDeviceGetInfo: proc "c" (pDevice: ^device, type: device_type, pDeviceInfo: ^device_info) -> result, }
These are the callbacks required to be implemented for a backend. These callbacks are grouped into two parts: context and device. There is one context to many devices. A device is created from a context.
The general flow goes like this:
1) A context is created with onContextInit()
1a) Available devices can be enumerated with onContextEnumerateDevices()
if required.
1b) Detailed information about a device can be queried with onContextGetDeviceInfo()
if required.
2) A device is created from the context that was created in the first step using onDeviceInit()
, and optionally a device ID that was
selected from device enumeration via onContextEnumerateDevices()
.
3) A device is started or stopped with onDeviceStart()
/ onDeviceStop()
4) Data is delivered to and from the device by the backend. This is always done based on the native format returned by the prior call
to onDeviceInit()
. Conversion between the device's native format and the format requested by the application will be handled by
miniaudio internally.
Initialization of the context is quite simple. You need to do any necessary initialization of internal objects and then output the callbacks defined in this structure.
Once the context has been initialized you can initialize a device. Before doing so, however, the application may want to know which
physical devices are available. This is where onContextEnumerateDevices()
comes in. This is fairly simple. For each device, fire the
given callback with, at a minimum, the basic information filled out in ma_device_info
. When the callback returns MA_FALSE
, enumeration
needs to stop and the onContextEnumerateDevices()
function returns with a success code.
Detailed device information can be retrieved from a device ID using onContextGetDeviceInfo()
. This takes as input the device type and ID,
and on output returns detailed information about the device in ma_device_info
. The onContextGetDeviceInfo()
callback must handle the
case when the device ID is NULL, in which case information about the default device needs to be retrieved.
Once the context has been created and the device ID retrieved (if using anything other than the default device), the device can be created. This is a little bit more complicated than initialization of the context due to it's more complicated configuration. When initializing a device, a duplex device may be requested. This means a separate data format needs to be specified for both playback and capture. On input, the data format is set to what the application wants. On output it's set to the native format which should match as closely as possible to the requested format. The conversion between the format requested by the application and the device's native format will be handled internally by miniaudio.
On input, if the sample format is set to ma_format_unknown
, the backend is free to use whatever sample format it desires, so long as it's
supported by miniaudio. When the channel count is set to 0, the backend should use the device's native channel count. The same applies for
sample rate. For the channel map, the default should be used when ma_channel_map_is_blank()
returns true (all channels set to
MA_CHANNEL_NONE
). On input, the periodSizeInFrames
or periodSizeInMilliseconds
option should always be set. The backend should
inspect both of these variables. If periodSizeInFrames
is set, it should take priority, otherwise it needs to be derived from the period
size in milliseconds (periodSizeInMilliseconds
) and the sample rate, keeping in mind that the sample rate may be 0, in which case the
sample rate will need to be determined before calculating the period size in frames. On output, all members of the ma_device_descriptor
object should be set to a valid value, except for periodSizeInMilliseconds
which is optional (periodSizeInFrames
must be set).
Starting and stopping of the device is done with onDeviceStart()
and onDeviceStop()
and should be self-explanatory. If the backend uses
asynchronous reading and writing, onDeviceStart()
and onDeviceStop()
should always be implemented.
The handling of data delivery between the application and the device is the most complicated part of the process. To make this a bit
easier, some helper callbacks are available. If the backend uses a blocking read/write style of API, the onDeviceRead()
and
onDeviceWrite()
callbacks can optionally be implemented. These are blocking and work just like reading and writing from a file. If the
backend uses a callback for data delivery, that callback must call ma_device_handle_backend_data_callback()
from within it's callback.
This allows miniaudio to then process any necessary data conversion and then pass it to the miniaudio data callback.
If the backend requires absolute flexibility with it's data delivery, it can optionally implement the onDeviceDataLoop()
callback
which will allow it to implement the logic that will run on the audio thread. This is much more advanced and is completely optional.
The audio thread should run data delivery logic in a loop while ma_device_get_state() == ma_device_state_started
and no errors have been
encountered. Do not start or stop the device here. That will be handled from outside the onDeviceDataLoop()
callback.
The invocation of the onDeviceDataLoop()
callback will be handled by miniaudio. When you start the device, miniaudio will fire this
callback. When the device is stopped, the ma_device_get_state() == ma_device_state_started
condition will fail and the loop will be terminated
which will then fall through to the part that stops the device. For an example on how to implement the onDeviceDataLoop()
callback,
look at ma_device_audio_thread__default_read_write()
. Implement the onDeviceDataLoopWakeup()
callback if you need a mechanism to
wake up the audio thread.
If the backend supports an optimized retrieval of device information from an initialized ma_device
object, it should implement the
onDeviceGetInfo()
callback. This is optional, in which case it will fall back to onContextGetDeviceInfo()
which is less efficient.
biquad ¶
biquad :: struct { format: format, channels: u32, b0: biquad_coefficient, b1: biquad_coefficient, b2: biquad_coefficient, a1: biquad_coefficient, a2: biquad_coefficient, pR1: ^biquad_coefficient, pR2: ^biquad_coefficient, // Memory management. _pHeap: rawptr, _ownsHeap: b32, }
Related Procedures With Parameters
biquad_coefficient ¶
*********************************
Biquad Filtering
*********************************
biquad_config ¶
biquad_config :: struct { format: format, channels: u32, b0: f64, b1: f64, b2: f64, a0: f64, a1: f64, a2: f64, }
Related Procedures With Parameters
Related Procedures With Returns
biquad_node ¶
Related Procedures With Parameters
biquad_node_config ¶
biquad_node_config :: struct { nodeConfig: node_config, biquad: biquad_config, }
Biquad Node
Related Procedures With Parameters
Related Procedures With Returns
bpf ¶
bpf :: struct { format: format, channels: u32, bpf2Count: u32, pBPF2: ^bpf2, // Memory management. _pHeap: rawptr, _ownsHeap: b32, }
Related Procedures With Parameters
bpf2_config ¶
bpf2_config :: struct { format: format, channels: u32, sampleRate: u32, cutoffFrequency: f64, q: f64, }
*********************************
Band-Pass Filtering
*********************************
Related Procedures With Parameters
Related Procedures With Returns
bpf_config ¶
bpf_config :: struct { format: format, channels: u32, sampleRate: u32, cutoffFrequency: f64, order: u32, }
Related Procedures With Parameters
Related Procedures With Returns
bpf_node ¶
Related Procedures With Parameters
bpf_node_config ¶
bpf_node_config :: struct { nodeConfig: node_config, bpf: bpf_config, }
Band Pass Filter Node
Related Procedures With Parameters
Related Procedures With Returns
channel ¶
channel :: enum u8 { NONE = 0, MONO = 1, FRONT_LEFT = 2, FRONT_RIGHT = 3, FRONT_CENTER = 4, LFE = 5, BACK_LEFT = 6, BACK_RIGHT = 7, FRONT_LEFT_CENTER = 8, FRONT_RIGHT_CENTER = 9, BACK_CENTER = 10, SIDE_LEFT = 11, SIDE_RIGHT = 12, TOP_CENTER = 13, TOP_FRONT_LEFT = 14, TOP_FRONT_CENTER = 15, TOP_FRONT_RIGHT = 16, TOP_BACK_LEFT = 17, TOP_BACK_CENTER = 18, TOP_BACK_RIGHT = 19, AUX_0 = 20, AUX_1 = 21, AUX_2 = 22, AUX_3 = 23, AUX_4 = 24, AUX_5 = 25, AUX_6 = 26, AUX_7 = 27, AUX_8 = 28, AUX_9 = 29, AUX_10 = 30, AUX_11 = 31, AUX_12 = 32, AUX_13 = 33, AUX_14 = 34, AUX_15 = 35, AUX_16 = 36, AUX_17 = 37, AUX_18 = 38, AUX_19 = 39, AUX_20 = 40, AUX_21 = 41, AUX_22 = 42, AUX_23 = 43, AUX_24 = 44, AUX_25 = 45, AUX_26 = 46, AUX_27 = 47, AUX_28 = 48, AUX_29 = 49, AUX_30 = 50, AUX_31 = 51, LEFT = 2, RIGHT = 3, POSITION_COUNT = 52, }
Related Procedures With Parameters
- channel_converter_config_init
- channel_converter_get_input_channel_map
- channel_converter_get_output_channel_map
- channel_map_contains_channel_position
- channel_map_copy
- channel_map_copy_or_default
- channel_map_find_channel_position
- channel_map_get_channel
- channel_map_init_blank
- channel_map_init_standard
- channel_map_is_blank
- channel_map_is_equal
- channel_map_is_valid
- channel_map_to_string
- channel_position_to_string
- data_converter_get_input_channel_map
- data_converter_get_output_channel_map
- data_source_get_data_format
- decoder_get_data_format
- resource_manager_data_buffer_get_data_format
- resource_manager_data_source_get_data_format
- resource_manager_data_stream_get_data_format
- sound_get_data_format
Related Procedures With Returns
channel_conversion_path ¶
channel_conversion_path :: enum i32 { unknown, passthrough, mono_out, // Converting to mono. mono_in, // Converting from mono. shuffle, // Simple shuffle. Will use this when all channels are present in both input and output channel maps, but just in a different order. weights, // Blended based on weights. }
*********************************
Channel Conversion
*********************************
channel_converter ¶
channel_converter :: struct { format: format, channelsIn: u32, channelsOut: u32, mixingMode: channel_mix_mode, conversionPath: channel_conversion_path, pChannelMapIn: [^]channel, pChannelMapOut: [^]channel, pShuffleTable: [^]u8, weights: struct #raw_union { // [in][out] f32: ^[^]f32, s16: ^[^]i32, }, // Memory management. _pHeap: rawptr, _ownsHeap: b32, }
Related Procedures With Parameters
channel_converter_config ¶
channel_converter_config :: struct { format: format, channelsIn: u32, channelsOut: u32, pChannelMapIn: [^]channel, pChannelMapOut: [^]channel, mixingMode: channel_mix_mode, calculateLFEFromSpatialChannels: b32, // When an output LFE channel is present, but no input LFE, set to true to set the output LFE to the average of all spatial channels (LR, FR, etc.). Ignored when an input LFE is present. ppWeights: ^[^]f32, }
Related Procedures With Parameters
Related Procedures With Returns
channel_mix_mode ¶
channel_mix_mode :: enum i32 { rectangular = 0, // Simple averaging based on the plane(s) the channel is sitting on. simple, // Drop excess channels; zeroed out extra channels. custom_weights, // Use custom weights specified in ma_channel_converter_config. default = 0, }
Related Procedures With Parameters
context_command__wasapi ¶
context_command__wasapi :: struct { code: i32, pEvent: ^event, // This will be signalled when the event is complete. data: struct #raw_union { quit: struct { _unused: i32, }, createAudioClient: struct { deviceType: device_type, pAudioClient: rawptr, ppAudioClientService: ^rawptr, pResult: ^result, }, releaseAudioClient: struct { pDevice: ^device, deviceType: device_type, }, }, }
WASAPI specific structure for some commands which must run on a common thread due to bugs in WASAPI.
context_config ¶
context_config :: struct { pLog: ^log, threadPriority: thread_priority, threadStackSize: uint, pUserData: rawptr, allocationCallbacks: allocation_callbacks, alsa: struct { useVerboseDeviceEnumeration: b32, }, pulse: struct { pApplicationName: cstring, pServerName: cstring, tryAutoSpawn: b32, }, coreaudio: struct { sessionCategory: ios_session_category, sessionCategoryOptions: u32, noAudioSessionActivate: b32, // iOS only. When set to true, does not perform an explicit [[AVAudioSession sharedInstace] setActive:true] on initialization. noAudioSessionDeactivate: b32, }, jack: struct { pClientName: cstring, tryStartServer: b32, }, custom: backend_callbacks, }
Related Procedures With Parameters
Related Procedures With Returns
context_type ¶
context_type :: struct { callbacks: backend_callbacks, backend: backend, // DirectSound, ALSA, etc. pLog: ^log, log: log, // Only used if the log is owned by the context. The pLog member will be set to &log in this case. threadPriority: thread_priority, threadStackSize: uint, pUserData: rawptr, allocationCallbacks: allocation_callbacks, deviceEnumLock: mutex, // Used to make ma_context_get_devices() thread safe. deviceInfoLock: mutex, // Used to make ma_context_get_device_info() thread safe. deviceInfoCapacity: u32, // Total capacity of pDeviceInfos. playbackDeviceInfoCount: u32, captureDeviceInfoCount: u32, pDeviceInfos: [^]device_info, // Playback devices first, then capture. using _: struct #raw_union { wasapi: struct { commandThread: thread, commandLock: mutex, commandSem: semaphore, commandIndex: u32, commandCount: u32, commands: [4]context_command__wasapi, hAvrt: handle, AvSetMmThreadCharacteristicsA: proc "stdcall" (), AvRevertMmThreadCharacteristics: proc "stdcall" (), hMMDevapi: handle, ActivateAudioInterfaceAsync: proc "stdcall" (), }, dsound: struct { hDSoundDLL: handle, DirectSoundCreate: proc "stdcall" (), DirectSoundEnumerateA: proc "stdcall" (), DirectSoundCaptureCreate: proc "stdcall" (), DirectSoundCaptureEnumerateA: proc "stdcall" (), }, winmm: struct { hWinMM: handle, waveOutGetNumDevs: proc "stdcall" (), waveOutGetDevCapsA: proc "stdcall" (), waveOutOpen: proc "stdcall" (), waveOutClose: proc "stdcall" (), waveOutPrepareHeader: proc "stdcall" (), waveOutUnprepareHeader: proc "stdcall" (), waveOutWrite: proc "stdcall" (), waveOutReset: proc "stdcall" (), waveInGetNumDevs: proc "stdcall" (), waveInGetDevCapsA: proc "stdcall" (), waveInOpen: proc "stdcall" (), waveInClose: proc "stdcall" (), waveInPrepareHeader: proc "stdcall" (), waveInUnprepareHeader: proc "stdcall" (), waveInAddBuffer: proc "stdcall" (), waveInStart: proc "stdcall" (), waveInReset: proc "stdcall" (), }, alsa: struct {}, pulse: struct {}, jack: struct { jackSO: handle, jack_client_open: proc "stdcall" (), jack_client_close: proc "stdcall" (), jack_client_name_size: proc "stdcall" (), jack_set_process_callback: proc "stdcall" (), jack_set_buffer_size_callback: proc "stdcall" (), jack_on_shutdown: proc "stdcall" (), jack_get_sample_rate: proc "stdcall" (), jack_get_buffer_size: proc "stdcall" (), jack_get_ports: proc "stdcall" (), jack_activate: proc "stdcall" (), jack_deactivate: proc "stdcall" (), jack_connect: proc "stdcall" (), jack_port_register: proc "stdcall" (), jack_port_name: proc "stdcall" (), jack_port_get_buffer: proc "stdcall" (), jack_free: proc "stdcall" (), pClientName: cstring, tryStartServer: b32, }, coreaudio: struct {}, sndio: struct {}, audio4: struct {}, oss: struct {}, aaudio: struct {}, opensl: struct {}, webaudio: struct {}, null_backend: struct { _unused: i32, }, }, using _: struct #raw_union { win32: struct { hOle32DLL: handle, CoInitialize: proc "stdcall" (), CoInitializeEx: proc "stdcall" (), CoUninitialize: proc "stdcall" (), CoCreateInstance: proc "stdcall" (), CoTaskMemFree: proc "stdcall" (), PropVariantClear: proc "stdcall" (), StringFromGUID2: proc "stdcall" (), hUser32DLL: handle, GetForegroundWindow: proc "stdcall" (), GetDesktopWindow: proc "stdcall" (), hAdvapi32DLL: handle, RegOpenKeyExA: proc "stdcall" (), RegCloseKey: proc "stdcall" (), RegQueryValueExA: proc "stdcall" (), CoInitializeResult: i32, }, posix: struct {}, _unused: i32, }, }
Related Procedures With Parameters
- context_enumerate_devices
- context_get_device_info
- context_get_devices
- context_get_log
- context_init
- context_is_loopback_supported
- context_uninit
- device_init
Related Procedures With Returns
data_converter ¶
data_converter :: struct { formatIn: format, formatOut: format, channelsIn: u32, channelsOut: u32, sampleRateIn: u32, sampleRateOut: u32, ditherMode: dither_mode, executionPath: data_converter_execution_path, // The execution path the data converter will follow when processing. channelConverter: channel_converter, resampler: resampler, hasPreFormatConversion: b8, hasPostFormatConversion: b8, hasChannelConverter: b8, hasResampler: b8, isPassthrough: b8, // Memory management. _ownsHeap: b8, _pHeap: rawptr, }
Related Procedures With Parameters
- data_converter_get_expected_output_frame_count
- data_converter_get_input_channel_map
- data_converter_get_input_latency
- data_converter_get_output_channel_map
- data_converter_get_output_latency
- data_converter_get_required_input_frame_count
- data_converter_init
- data_converter_init_preallocated
- data_converter_process_pcm_frames
- data_converter_reset
- data_converter_set_rate
- data_converter_set_rate_ratio
- data_converter_uninit
data_converter_config ¶
data_converter_config :: struct { formatIn: format, formatOut: format, channelsIn: u32, channelsOut: u32, sampleRateIn: u32, sampleRateOut: u32, pChannelMapIn: [^]channel, pChannelMapOut: [^]channel, ditherMode: dither_mode, channelMixMode: channel_mix_mode, calculateLFEFromSpatialChannels: b32, // When an output LFE channel is present, but no input LFE, set to true to set the output LFE to the average of all spatial channels (LR, FR, etc.). Ignored when an input LFE is present. ppChannelWeights: ^[^]f32, // [in][out]. Only used when channelMixMode is set to ma_channel_mix_mode_custom_weights. allowDynamicSampleRate: b32, resampling: resampler_config, }
*********************************
Data Conversion
*********************************
Related Procedures With Parameters
Related Procedures With Returns
data_converter_execution_path ¶
data_converter_execution_path :: enum i32 { passthrough, // No conversion. format_only, // Only format conversion. channels_only, // Only channel conversion. resample_only, // Only resampling. resample_first, // All conversions, but resample as the first step. channels_first, // All conversions, but channels as the first step. }
data_source ¶
data_source :: struct {}
Related Procedures With Parameters
- data_source_get_current
- data_source_get_cursor_in_pcm_frames
- data_source_get_cursor_in_seconds
- data_source_get_data_format
- data_source_get_length_in_pcm_frames
- data_source_get_length_in_seconds
- data_source_get_loop_point_in_pcm_frames
- data_source_get_next
- data_source_get_next_callback
- data_source_get_range_in_pcm_frames
- data_source_init
- data_source_is_looping
- data_source_node_config_init
- data_source_read_pcm_frames
- data_source_seek_pcm_frames
- data_source_seek_to_pcm_frame
- data_source_set_current
- data_source_set_loop_point_in_pcm_frames
- data_source_set_looping
- data_source_set_next
- data_source_set_next_callback
- data_source_set_range_in_pcm_frames
- data_source_uninit
- sound_init_from_data_source
Related Procedures With Returns
data_source_base ¶
data_source_base :: struct { vtable: ^data_source_vtable, rangeBegInFrames: u64, rangeEndInFrames: u64, // Set to -1 for unranged (default). loopBegInFrames: u64, // Relative to rangeBegInFrames. loopEndInFrames: u64, // Relative to rangeBegInFrames. Set to -1 for the end of the range. pCurrent: ^data_source, // When non-NULL, the data source being initialized will act as a proxy and will route all operations to pCurrent. Used in conjunction with pNext/onGetNext for seamless chaining. pNext: ^data_source, // When set to NULL, onGetNext will be used. onGetNext: data_source_get_next_proc, // Will be used when pNext is NULL. If both are NULL, no next will be used. isLooping: b32, }
data_source_config ¶
data_source_config :: struct { vtable: ^data_source_vtable, }
Related Procedures With Parameters
Related Procedures With Returns
data_source_get_next_proc ¶
data_source_get_next_proc :: proc "c" (pDataSource: ^data_source) -> ^data_source
Related Procedures With Parameters
Related Procedures With Returns
data_source_node ¶
data_source_node :: struct { base: node_base, pDataSource: ^data_source, }
Related Procedures With Parameters
data_source_node_config ¶
data_source_node_config :: struct { nodeConfig: node_config, pDataSource: ^data_source, }
Data source node. 0 input buses, 1 output bus. Used for reading from a data source.
Related Procedures With Parameters
Related Procedures With Returns
data_source_vtable ¶
data_source_vtable :: struct { onRead: proc "c" (pDataSource: ^data_source, pFramesOut: rawptr, frameCount: u64, pFramesRead: ^u64) -> result, onSeek: proc "c" (pDataSource: ^data_source, frameIndex: u64) -> result, onGetDataFormat: proc "c" (pDataSource: ^data_source, pFormat: ^format, pChannels: ^u32, pSampleRate: ^u32, pChannelMap: [^]channel, channelMapCap: uint) -> result, onGetCursor: proc "c" (pDataSource: ^data_source, pCursor: ^u64) -> result, onGetLength: proc "c" (pDataSource: ^data_source, pLength: ^u64) -> result, onSetLooping: proc "c" (pDataSource: ^data_source, isLooping: b32) -> result, flags: u32, }
decoder ¶
decoder :: struct { ds: data_source_base, pBackend: ^data_source, // The decoding backend we'll be pulling data from. pBackendVTable: ^decoding_backend_vtable, // The vtable for the decoding backend. This needs to be stored so we can access the onUninit() callback. pBackendUserData: rawptr, onRead: decoder_read_proc, onSeek: decoder_seek_proc, onTell: decoder_tell_proc, pUserData: rawptr, readPointerInPCMFrames: u64, // In output sample rate. Used for keeping track of how many frames are available for decoding. outputFormat: format, outputChannels: u32, outputSampleRate: u32, converter: data_converter, // <-- Data conversion is achieved by running frames through this. pInputCache: rawptr, // In input format. Can be null if it's not needed. inputCacheCap: u64, // The capacity of the input cache. inputCacheConsumed: u64, // The number of frames that have been consumed in the cache. Used for determining the next valid frame. inputCacheRemaining: u64, // The number of valid frames remaining in the cahce. allocationCallbacks: allocation_callbacks, data: struct #raw_union { vfs: struct { pVFS: ^vfs, file: vfs_file, }, memory: struct { pData: [^]u8, dataSize: uint, currentReadPos: uint, }, }, }
Related Procedures With Parameters
decoder_config ¶
decoder_config :: struct { format: format, // Set to 0 or ma_format_unknown to use the stream's internal format. channels: u32, // Set to 0 to use the stream's internal channels. sampleRate: u32, // Set to 0 to use the stream's internal sample rate. channelMap: [^]channel, channelMixMode: channel_mix_mode, ditherMode: dither_mode, resampling: resampler_config, allocationCallbacks: allocation_callbacks, encodingFormat: encoding_format, seekPointCount: u32, // When set to > 0, specifies the number of seek points to use for the generation of a seek table. Not all decoding backends support this. ppCustomBackendVTables: ^[^]decoding_backend_vtable, customBackendCount: u32, pCustomBackendUserData: rawptr, }
Related Procedures With Parameters
- decode_file
- decode_from_vfs
- decode_memory
- decoder_init
- decoder_init_file
- decoder_init_file_w
- decoder_init_memory
- decoder_init_vfs
- decoder_init_vfs_w
Related Procedures With Returns
decoder_read_proc ¶
decoder_read_proc :: proc "c" (pDecoder: ^decoder, pBufferOut: rawptr, bytesToRead: uint, pBytesRead: ^uint) -> result
Returns the number of bytes read.
Related Procedures With Parameters
decoder_seek_proc ¶
decoder_seek_proc :: proc "c" (pDecoder: ^decoder, byteOffset: i64, origin: seek_origin) -> result
Related Procedures With Parameters
decoding_backend_config ¶
Related Procedures With Returns
decoding_backend_vtable ¶
decoding_backend_vtable :: struct { onInit: proc "c" (pUserData: rawptr, onRead: decoder_read_proc, onSeek: decoder_seek_proc, onTell: decoder_tell_proc, pReadSeekTellUserData: rawptr, pConfig: ^decoding_backend_config, pAllocationCallbacks: ^allocation_callbacks, ppBackend: ^^data_source) -> result, onInitFile: proc "c" (pUserData: rawptr, pFilePath: cstring, pConfig: ^decoding_backend_config, pAllocationCallbacks: ^allocation_callbacks, ppBackend: ^^data_source) -> result, // Optional. onInitFileW: proc "c" (pUserData: rawptr, pFilePath: [^]u16, pConfig: ^decoding_backend_config, pAllocationCallbacks: ^allocation_callbacks, ppBackend: ^^data_source) -> result, // Optional. onInitMemory: proc "c" (pUserData: rawptr, pData: rawptr, dataSize: uint, pConfig: ^decoding_backend_config, pAllocationCallbacks: ^allocation_callbacks, ppBackend: ^^data_source) -> result, // Optional. onUninit: proc "c" (pUserData: rawptr, pBackend: ^data_source, pAllocationCallbacks: ^allocation_callbacks), }
default_vfs ¶
default_vfs :: struct { cb: vfs_callbacks, allocationCallbacks: allocation_callbacks, }
Related Procedures With Parameters
delay ¶
delay :: struct { config: delay_config, cursor: u32, // Feedback is written to this cursor. Always equal or in front of the read cursor. bufferSizeInFrames: u32, pBuffer: [^]f32, }
Related Procedures With Parameters
delay_config ¶
delay_config :: struct { channels: u32, sampleRate: u32, delayInFrames: u32, delayStart: b32, // Set to true to delay the start of the output; false otherwise. wet: f32, // 0..1. Default = 1. dry: f32, // 0..1. Default = 1. decay: f32, }
Delay
Related Procedures With Parameters
Related Procedures With Returns
delay_node ¶
Related Procedures With Parameters
delay_node_config ¶
delay_node_config :: struct { nodeConfig: node_config, delay: delay_config, }
Delay Filter Node
Related Procedures With Parameters
Related Procedures With Returns
device ¶
device :: struct { pContext: ^context_type, type: device_type, sampleRate: u32, state: u32, // atomic // The state of the device is variable and can change at any time on any thread. Must be used atomically. onData: device_data_proc, // Set once at initialization time and should not be changed after. onNotification: device_notification_proc, // Set once at initialization time and should not be changed after. onStop: stop_proc, // DEPRECATED. Use the notification callback instead. Set once at initialization time and should not be changed after. pUserData: rawptr, // Application defined data. startStopLock: mutex, wakeupEvent: event, startEvent: event, stopEvent: event, device_thread: thread, workResult: result, // This is set by the worker thread after it's finished doing a job. isOwnerOfContext: b8, // When set to true, uninitializing the device will also uninitialize the context. Set to true when NULL is passed into ma_device_init(). noPreSilencedOutputBuffer: b8, noClip: b8, noDisableDenormals: b8, noFixedSizedCallback: b8, masterVolumeFactor: f32, // atomic // Linear 0..1. Can be read and written simultaneously by different threads. Must be used atomically. duplexRB: duplex_rb, // Intermediary buffer for duplex device on asynchronous backends. resampling: struct { algorithm: resample_algorithm, pBackendVTable: ^resampling_backend_vtable, pBackendUserData: rawptr, linear: struct { lpfOrder: u32, }, }, playback: struct { pID: ^device_id, // Set to NULL if using default ID, otherwise set to the address of "id". id: device_id, // If using an explicit device, will be set to a copy of the ID used for initialization. Otherwise cleared to 0. name: [256]u8, // Maybe temporary. Likely to be replaced with a query API. shareMode: share_mode, // Set to whatever was passed in when the device was initialized. playback_format: format, channels: u32, channelMap: [254]channel, internalFormat: format, internalChannels: u32, internalSampleRate: u32, internalChannelMap: [254]channel, internalPeriodSizeInFrames: u32, internalPeriods: u32, channelMixMode: channel_mix_mode, calculateLFEFromSpatialChannels: b32, converter: data_converter, pIntermediaryBuffer: rawptr, // For implementing fixed sized buffer callbacks. Will be null if using variable sized callbacks. intermediaryBufferCap: u32, intermediaryBufferLen: u32, // How many valid frames are sitting in the intermediary buffer. pInputCache: rawptr, // In external format. Can be null. inputCacheCap: u64, inputCacheConsumed: u64, inputCacheRemaining: u64, }, capture: struct { pID: ^device_id, // Set to NULL if using default ID, otherwise set to the address of "id". id: device_id, // If using an explicit device, will be set to a copy of the ID used for initialization. Otherwise cleared to 0. name: [256]u8, // Maybe temporary. Likely to be replaced with a query API. shareMode: share_mode, // Set to whatever was passed in when the device was initialized. capture_format: format, channels: u32, channelMap: [254]channel, internalFormat: format, internalChannels: u32, internalSampleRate: u32, internalChannelMap: [254]channel, internalPeriodSizeInFrames: u32, internalPeriods: u32, channelMixMode: channel_mix_mode, calculateLFEFromSpatialChannels: b32, converter: data_converter, pIntermediaryBuffer: rawptr, // For implementing fixed sized buffer callbacks. Will be null if using variable sized callbacks. intermediaryBufferCap: u32, intermediaryBufferLen: u32, }, using _: struct #raw_union { wasapi: struct { pAudioClientPlayback: rawptr, pAudioClientCapture: rawptr, pRenderClient: rawptr, pCaptureClient: rawptr, pDeviceEnumerator: rawptr, // Used for IMMNotificationClient notifications. Required for detecting default device changes. notificationClient: IMMNotificationClient, hEventPlayback: handle, hEventCapture: handle, // Auto reset. Initialized to unsignaled. actualPeriodSizeInFramesPlayback: u32, // Value from GetBufferSize(). internalPeriodSizeInFrames is not set to the _actual_ buffer size when low-latency shared mode is being used due to the way the IAudioClient3 API works. actualPeriodSizeInFramesCapture: u32, originalPeriodSizeInFrames: u32, originalPeriodSizeInMilliseconds: u32, originalPeriods: u32, originalPerformanceProfile: performance_profile, periodSizeInFramesPlayback: u32, periodSizeInFramesCapture: u32, pMappedBufferCapture: rawptr, mappedBufferCaptureCap: u32, mappedBufferCaptureLen: u32, pMappedBufferPlayback: rawptr, mappedBufferPlaybackCap: u32, mappedBufferPlaybackLen: u32, isStartedCapture: b32, // atomic // Can be read and written simultaneously across different threads. Must be used atomically, and must be 32-bit. isStartedPlayback: b32, // atomic // Can be read and written simultaneously across different threads. Must be used atomically, and must be 32-bit. loopbackProcessID: u32, loopbackProcessExclude: b8, noAutoConvertSRC: b8, // When set to true, disables the use of AUDCLNT_STREAMFLAGS_AUTOCONVERTPCM. noDefaultQualitySRC: b8, // When set to true, disables the use of AUDCLNT_STREAMFLAGS_SRC_DEFAULT_QUALITY. noHardwareOffloading: b8, allowCaptureAutoStreamRouting: b8, allowPlaybackAutoStreamRouting: b8, isDetachedPlayback: b8, isDetachedCapture: b8, usage: wasapi_usage, hAvrtHandle: rawptr, rerouteLock: mutex, }, dsound: struct { pPlayback: rawptr, pPlaybackPrimaryBuffer: rawptr, pPlaybackBuffer: rawptr, pCapture: rawptr, pCaptureBuffer: rawptr, }, winmm: struct { hDevicePlayback: handle, hDeviceCapture: handle, hEventPlayback: handle, hEventCapture: handle, fragmentSizeInFrames: u32, iNextHeaderPlayback: u32, // [0,periods). Used as an index into pWAVEHDRPlayback. iNextHeaderCapture: u32, // [0,periods). Used as an index into pWAVEHDRCapture. headerFramesConsumedPlayback: u32, // The number of PCM frames consumed in the buffer in pWAVEHEADER[iNextHeader]. headerFramesConsumedCapture: u32, pWAVEHDRPlayback: [^]u8, pWAVEHDRCapture: [^]u8, // One instantiation for each period. pIntermediaryBufferPlayback: [^]u8, pIntermediaryBufferCapture: [^]u8, _pHeapData: [^]u8, }, alsa: struct {}, pulse: struct {}, jack: struct { pClient: rawptr, pPortsPlayback: [^]rawptr, pPortsCapture: [^]rawptr, pIntermediaryBufferPlayback: [^]f32, // Typed as a float because JACK is always floating point. pIntermediaryBufferCapture: [^]f32, }, coreaudio: struct {}, sndio: struct {}, audio4: struct {}, oss: struct {}, aaudio: struct {}, opensl: struct {}, webaudio: struct {}, null_device: struct { deviceThread: thread, operationEvent: event, operationCompletionEvent: event, operationSemaphore: semaphore, operation: u32, operationResult: result, timer: timer, priorRunTime: f64, currentPeriodFramesRemainingPlayback: u32, currentPeriodFramesRemainingCapture: u32, lastProcessedFramePlayback: u64, lastProcessedFrameCapture: u64, sStarted: b32, }, }, }
Related Procedures With Parameters
- device_get_context
- device_get_info
- device_get_log
- device_get_master_volume
- device_get_master_volume_db
- device_get_name
- device_get_state
- device_handle_backend_data_callback
- device_init
- device_init_ex
- device_is_started
- device_post_init
- device_set_master_volume
- device_set_master_volume_db
- device_start
- device_stop
- device_uninit
Related Procedures With Returns
device_config ¶
device_config :: struct { deviceType: device_type, sampleRate: u32, periodSizeInFrames: u32, periodSizeInMilliseconds: u32, periods: u32, performanceProfile: performance_profile, noPreSilencedOutputBuffer: b8, // When set to true, the contents of the output buffer passed into the data callback will be left undefined rather than initialized to zero. noClip: b8, // When set to true, the contents of the output buffer passed into the data callback will not be clipped after returning. Only applies when the playback sample format is f32. noDisableDenormals: b8, // Do not disable denormals when firing the data callback. noFixedSizedCallback: b8, // Disables strict fixed-sized data callbacks. Setting this to true will result in the period size being treated only as a hint to the backend. This is an optimization for those who don't need fixed sized callbacks. dataCallback: device_data_proc, notificationCallback: device_notification_proc, stopCallback: stop_proc, pUserData: rawptr, resampling: resampler_config, playback: struct { pDeviceID: ^device_id, format: format, channels: u32, channelMap: [^]channel, channelMixMode: channel_mix_mode, calculateLFEFromSpatialChannels: b32, // When an output LFE channel is present, but no input LFE, set to true to set the output LFE to the average of all spatial channels (LR, FR, etc.). Ignored when an input LFE is present. shareMode: share_mode, }, capture: struct { pDeviceID: ^device_id, format: format, channels: u32, channelMap: [^]channel, channelMixMode: channel_mix_mode, calculateLFEFromSpatialChannels: b32, // When an output LFE channel is present, but no input LFE, set to true to set the output LFE to the average of all spatial channels (LR, FR, etc.). Ignored when an input LFE is present. shareMode: share_mode, }, wasapi: struct { usage: wasapi_usage, // When configured, uses Avrt APIs to set the thread characteristics. noAutoConvertSRC: b8, // When set to true, disables the use of AUDCLNT_STREAMFLAGS_AUTOCONVERTPCM. noDefaultQualitySRC: b8, // When set to true, disables the use of AUDCLNT_STREAMFLAGS_SRC_DEFAULT_QUALITY. noAutoStreamRouting: b8, // Disables automatic stream routing. noHardwareOffloading: b8, // Disables WASAPI's hardware offloading feature. loopbackProcessID: u32, // The process ID to include or exclude for loopback mode. Set to 0 to capture audio from all processes. Ignored when an explicit device ID is specified. loopbackProcessExclude: b8, }, alsa: struct { noMMap: b32, // Disables MMap mode. noAutoFormat: b32, // Opens the ALSA device with SND_PCM_NO_AUTO_FORMAT. noAutoChannels: b32, // Opens the ALSA device with SND_PCM_NO_AUTO_CHANNELS. noAutoResample: b32, }, pulse: struct { pStreamNamePlayback: cstring, pStreamNameCapture: cstring, }, coreaudio: struct { allowNominalSampleRateChange: b32, }, opensl: struct { streamType: opensl_stream_type, recordingPreset: opensl_recording_preset, enableCompatibilityWorkarounds: b32, }, aaudio: struct { usage: aaudio_usage, contentType: aaudio_content_type, inputPreset: aaudio_input_preset, allowedCapturePolicy: aaudio_allowed_capture_policy, noAutoStartAfterReroute: b32, enableCompatibilityWorkarounds: b32, }, }
Related Procedures With Parameters
Related Procedures With Returns
device_data_proc ¶
The callback for processing audio data from the device.
The data callback is fired by miniaudio whenever the device needs to have more data delivered to a playback device, or when a capture device has some data available. This is called as soon as the backend asks for more data which means it may be called with inconsistent frame counts. You cannot assume the callback will be fired with a consistent frame count.
Parameters ---------- pDevice (in)
A pointer to the relevant device.
pOutput (out)
A pointer to the output buffer that will receive audio data that will later be played back through the speakers. This will be non-null for a playback or full-duplex device and null for a capture and loopback device.
pInput (in)
A pointer to the buffer containing input data from a recording device. This will be non-null for a capture, full-duplex or loopback device and null for a playback device.
frameCount (in)
The number of PCM frames to process. Note that this will not necessarily be equal to what you requested when you initialized the device. The `periodSizeInFrames` and `periodSizeInMilliseconds` members of the device config are just hints, and are not necessarily exactly what you'll get. You must not assume this will always be the same value each time the callback is fired.
Remarks ------- You cannot stop and start the device from inside the callback or else you'll get a deadlock. You must also not uninitialize the device from inside the callback. The following APIs cannot be called from inside the callback:
ma_device_init() ma_device_init_ex() ma_device_uninit() ma_device_start() ma_device_stop()
The proper way to stop the device is to call ma_device_stop()
from a different thread, normally the main application thread.
device_descriptor ¶
device_descriptor :: struct { pDeviceID: ^device_id, shareMode: share_mode, format: format, channels: u32, sampleRate: u32, channelMap: [254]channel, periodSizeInFrames: u32, periodSizeInMilliseconds: u32, periodCount: u32, }
Describes some basic details about a playback or capture device.
Related Procedures With Parameters
device_id ¶
device_id :: struct #raw_union { wasapi: [64]u16, // WASAPI uses a wchar_t string for identification. dsound: [16]u8, winmm: u32, // When creating a device, WinMM expects a Win32 UINT_PTR for device identification. In practice it's actually just a UINT. alsa: [256]u8, // ALSA uses a name string for identification. pulse: [256]u8, // PulseAudio uses a name string for identification. jack: i32, // JACK always uses default devices. coreaudio: [256]u8, // Core Audio uses a string for identification. sndio: [256]u8, // "snd/0", etc. audio4: [256]u8, // "/dev/audio", etc. oss: [64]u8, // "dev/dsp0", etc. "dev/dsp" for the default device. aaudio: i32, // AAudio uses a 32-bit integer for identification. opensl: u32, // OpenSL|ES uses a 32-bit unsigned integer for identification. webaudio: [32]u8, // Web Audio always uses default devices for now, but if this changes it'll be a GUID. custom: struct #raw_union { i: i32, s: [256]u8, p: rawptr, }, // The custom backend could be anything. Give them a few options. nullbackend: i32, }
Related Procedures With Parameters
device_info ¶
device_info :: struct { // Basic info. This is the only information guaranteed to be filled in during device enumeration. id: device_id, name: [256]u8, // +1 for null terminator. isDefault: b32, nativeDataFormatCount: u32, nativeDataFormats: [64]struct { // Not sure how big to make this. There can be *many* permutations for virtual devices which can support anything. format: format, // Sample format. If set to ma_format_unknown, all sample formats are supported. channels: u32, // If set to 0, all channels are supported. sampleRate: u32, // If set to 0, all sample rates are supported. flags: u32, }, }
Related Procedures With Parameters
device_job_thread ¶
Related Procedures With Parameters
device_job_thread_config ¶
device_job_thread_config :: struct { noThread: b32, // Set this to true if you want to process jobs yourself. jobQueueCapacity: u32, jobQueueFlags: u32, }
Device job thread. This is used by backends that require asynchronous processing of certain operations. It is not used by all backends.
The device job thread is made up of a thread and a job queue. You can post a job to the thread with ma_device_job_thread_post(). The thread will do the processing of the job.
Related Procedures With Parameters
Related Procedures With Returns
device_notification_proc ¶
device_notification_proc :: proc "c" (pNotification: ^device_notification)
The notification callback for when the application should be notified of a change to the device.
This callback is used for notifying the application of changes such as when the device has started, stopped, rerouted or an interruption has occurred. Note that not all backends will post all notification types. For example, some backends will perform automatic stream routing without any kind of notification to the host program which means miniaudio will never know about it and will never be able to fire the rerouted notification. You should keep this in mind when designing your program.
The stopped notification will not get fired when a device is rerouted.
Parameters
----------
pNotification (in)
A pointer to a structure containing information about the event. Use the pDevice
member of
this object to retrieve the relevant device. The type
member can be used to discriminate
against each of the notification types.
Remarks ------- Do not restart or uninitialize the device from the callback.
Not all notifications will be triggered by all backends, however the started and stopped events should be reliable for all backends. Some backends do not have a good way to detect device stoppages due to unplugging the device which may result in the stopped callback not getting fired. This has been observed with at least one BSD variant.
The rerouted notification is fired after the reroute has occurred. The stopped notification will not get fired when a device is rerouted. The following backends are known to do automatic stream rerouting, but do not have a way to be notified of the change:
* DirectSound
The interruption notifications are used on mobile platforms for detecting when audio is interrupted due to things like an incoming phone call. Currently this is only implemented on iOS. None of the Android backends will report this notification.
device_notification_type ¶
device_notification_type :: enum i32 { started, stopped, rerouted, interruption_began, interruption_ended, unlocked, }
Device notification types.
device_state ¶
device_state :: enum i32 { uninitialized = 0, stopped = 1, // The device's default state after initialization. started = 2, // The device is started and is requesting and/or delivering audio data. starting = 3, // Transitioning from a stopped state to started. stopping = 4, // Transitioning from a started state to stopped. }
Related Procedures With Returns
device_type ¶
device_type :: enum i32 { playback = 1, capture = 2, duplex = 3, // playback | capture loopback = 4, }
Related Procedures With Parameters
dither_mode ¶
dither_mode :: enum i32 { none = 0, rectangle, triangle, }
Related Procedures With Parameters
- convert_pcm_frames_format
- pcm_convert
- pcm_f32_to_s16
- pcm_f32_to_s24
- pcm_f32_to_s32
- pcm_f32_to_u8
- pcm_s16_to_f32
- pcm_s16_to_s24
- pcm_s16_to_s32
- pcm_s16_to_u8
- pcm_s24_to_f32
- pcm_s24_to_s16
- pcm_s24_to_s32
- pcm_s24_to_u8
- pcm_s32_to_f32
- pcm_s32_to_s16
- pcm_s32_to_s24
- pcm_s32_to_u8
- pcm_u8_to_f32
- pcm_u8_to_s16
- pcm_u8_to_s24
- pcm_u8_to_s32
duplex_rb ¶
duplex_rb :: struct { rb: pcm_rb, }
The idea of the duplex ring buffer is to act as the intermediary buffer when running two asynchronous devices in a duplex set up. The capture device writes to it, and then a playback device reads from it.
At the moment this is just a simple naive implementation, but in the future I want to implement some dynamic resampling to seamlessly handle desyncs. Note that the API is work in progress and may change at any time in any version.
The size of the buffer is based on the capture side since that's what'll be written to the buffer. It is based on the capture period size in frames. The internal sample rate of the capture device is also needed in order to calculate the size.
Related Procedures With Parameters
encoder ¶
encoder :: struct { config: encoder_config, onWrite: encoder_write_proc, onSeek: encoder_seek_proc, onInit: encoder_init_proc, onUninit: encoder_uninit_proc, onWritePCMFrames: encoder_write_pcm_frames_proc, pUserData: rawptr, pInternalEncoder: rawptr, data: struct { vfs: struct { pVFS: ^vfs, file: vfs_file, }, }, }
Related Procedures With Parameters
encoder_config ¶
encoder_config :: struct { encodingFormat: encoding_format, format: format, channels: u32, sampleRate: u32, allocationCallbacks: allocation_callbacks, }
Related Procedures With Parameters
Related Procedures With Returns
encoder_seek_proc ¶
encoder_seek_proc :: proc "c" (pEncoder: ^encoder, offset: i64, origin: seek_origin) -> result
Related Procedures With Parameters
encoder_uninit_proc ¶
encoder_uninit_proc :: proc "c" (pEncoder: ^encoder)
encoder_write_proc ¶
encoder_write_proc :: proc "c" (pEncoder: ^encoder, pBufferIn: rawptr, bytesToWrite: uint, pBytesWritten: ^uint) -> result
Related Procedures With Parameters
encoding_format ¶
encoding_format :: enum i32 { unknown = 0, wav, flac, mp3, vorbis, }
Related Procedures With Parameters
engine ¶
engine :: struct { nodeGraph: node_graph, // An engine is a node graph. It should be able to be plugged into any ma_node_graph API (with a cast) which means this must be the first member of this struct. pResourceManager: ^resource_manager, pDevice: ^device, // Optionally set via the config, otherwise allocated by the engine in ma_engine_init(). pLog: ^log, sampleRate: u32, listenerCount: u32, listeners: [4]spatializer_listener, allocationCallbacks: allocation_callbacks, ownsResourceManager: b8, ownsDevice: b8, inlinedSoundLock: spinlock, // For synchronizing access so the inlined sound list. pInlinedSoundHead: ^sound_inlined, // The first inlined sound. Inlined sounds are tracked in a linked list. inlinedSoundCount: u32, // atomic // The total number of allocated inlined sound objects. Used for debugging. gainSmoothTimeInFrames: u32, // The number of frames to interpolate the gain of spatialized sounds across. defaultVolumeSmoothTimeInPCMFrames: u32, monoExpansionMode: mono_expansion_mode, onProcess: engine_process_proc, pProcessUserData: rawptr, }
Related Procedures With Parameters
- engine_find_closest_listener
- engine_get_channels
- engine_get_device
- engine_get_endpoint
- engine_get_gain_db
- engine_get_listener_count
- engine_get_log
- engine_get_node_graph
- engine_get_resource_manager
- engine_get_sample_rate
- engine_get_time
- engine_get_time_in_milliseconds
- engine_get_time_in_pcm_frames
- engine_get_volume
- engine_init
- engine_listener_get_cone
- engine_listener_get_direction
- engine_listener_get_position
- engine_listener_get_velocity
- engine_listener_get_world_up
- engine_listener_is_enabled
- engine_listener_set_cone
- engine_listener_set_direction
- engine_listener_set_enabled
- engine_listener_set_position
- engine_listener_set_velocity
- engine_listener_set_world_up
- engine_node_config_init
- engine_play_sound
- engine_play_sound_ex
- engine_read_pcm_frames
- engine_set_gain_db
- engine_set_time
- engine_set_time_in_milliseconds
- engine_set_time_in_pcm_frames
- engine_set_volume
- engine_start
- engine_stop
- engine_uninit
- sound_config_init2
- sound_group_config_init2
- sound_group_init
- sound_group_init_ex
- sound_init_copy
- sound_init_ex
- sound_init_from_data_source
- sound_init_from_file
- sound_init_from_file_w
Related Procedures With Returns
engine_config ¶
engine_config :: struct { pResourceManager: ^resource_manager, // Can be null in which case a resource manager will be created for you. pContext: ^context_type, pDevice: ^device, // If set, the caller is responsible for calling ma_engine_data_callback() in the device's data callback. pPlaybackDeviceID: ^device_id, // The ID of the playback device to use with the default listener. dataCallback: device_data_proc, // Can be null. Can be used to provide a custom device data callback. notificationCallback: device_notification_proc, pLog: ^log, // When set to NULL, will use the context's log. listenerCount: u32, // Must be between 1 and MA_ENGINE_MAX_LISTENERS. channels: u32, // The number of channels to use when mixing and spatializing. When set to 0, will use the native channel count of the device. sampleRate: u32, // The sample rate. When set to 0 will use the native channel count of the device. periodSizeInFrames: u32, // If set to something other than 0, updates will always be exactly this size. The underlying device may be a different size, but from the perspective of the mixer that won't matter. periodSizeInMilliseconds: u32, // Used if periodSizeInFrames is unset. gainSmoothTimeInFrames: u32, // The number of frames to interpolate the gain of spatialized sounds across. If set to 0, will use gainSmoothTimeInMilliseconds. gainSmoothTimeInMilliseconds: u32, // When set to 0, gainSmoothTimeInFrames will be used. If both are set to 0, a default value will be used. defaultVolumeSmoothTimeInPCMFrames: u32, // Defaults to 0. Controls the default amount of smoothing to apply to volume changes to sounds. High values means more smoothing at the expense of high latency (will take longer to reach the new volume). allocationCallbacks: allocation_callbacks, noAutoStart: b32, // When set to true, requires an explicit call to ma_engine_start(). This is false by default, meaning the engine will be started automatically in ma_engine_init(). noDevice: b32, // When set to true, don't create a default device. ma_engine_read_pcm_frames() can be called manually to read data. monoExpansionMode: mono_expansion_mode, // Controls how the mono channel should be expanded to other channels when spatialization is disabled on a sound. pResourceManagerVFS: ^vfs, // A pointer to a pre-allocated VFS object to use with the resource manager. This is ignored if pResourceManager is not NULL. onProcess: engine_process_proc, // Fired at the end of each call to ma_engine_read_pcm_frames(). For engine's that manage their own internal device (the default configuration), this will be fired from the audio thread, and you do not need to call ma_engine_read_pcm_frames() manually in order to trigger this. pProcessUserData: rawptr, }
Related Procedures With Parameters
Related Procedures With Returns
engine_node ¶
engine_node :: struct { baseNode: node_base, // Must be the first member for compatiblity with the ma_node API. pEngine: ^engine, // A pointer to the engine. Set based on the value from the config. sampleRate: u32, // The sample rate of the input data. For sounds backed by a data source, this will be the data source's sample rate. Otherwise it'll be the engine's sample rate. volumeSmoothTimeInPCMFrames: u32, monoExpansionMode: mono_expansion_mode, fader: fader, resampler: linear_resampler, // For pitch shift. spatializer: spatializer, panner: panner, volumeGainer: gainer, // This will only be used if volumeSmoothTimeInPCMFrames is > 0. volume: f32, // atomic // Defaults to 1. pitch: f32, // atomic oldPitch: f32, // For determining whether or not the resampler needs to be updated to reflect the new pitch. The resampler will be updated on the mixing thread. oldDopplerPitch: f32, // For determining whether or not the resampler needs to be updated to take a new doppler pitch into account. isPitchDisabled: b32, // atomic // When set to true, pitching will be disabled which will allow the resampler to be bypassed to save some computation. isSpatializationDisabled: b32, // atomic // Set to false by default. When set to false, will not have spatialisation applied. pinnedListenerIndex: u32, // atomic // The index of the listener this node should always use for spatialization. If set to MA_LISTENER_INDEX_CLOSEST the engine will use the closest listener. fadeSettings: struct { volumeBeg: f32, // atomic volumeEnd: f32, // atomic fadeLengthInFrames: u64, // atomic // <-- Defaults to (~(ma_uint64)0) which is used to indicate that no fade should be applied. absoluteGlobalTimeInFrames: u64, }, // Memory management. _ownsHeap: b8, _pHeap: rawptr, }
Base node object for both ma_sound and ma_sound_group.
Related Procedures With Parameters
engine_node_config ¶
engine_node_config :: struct { pEngine: ^engine, type: engine_node_type, channelsIn: u32, channelsOut: u32, sampleRate: u32, // Only used when the type is set to ma_engine_node_type_sound. volumeSmoothTimeInPCMFrames: u32, monoExpansionMode: mono_expansion_mode, isPitchDisabled: b8, // Pitching can be explicitly disable with MA_SOUND_FLAG_NO_PITCH to optimize processing. isSpatializationDisabled: b8, // Spatialization can be explicitly disabled with MA_SOUND_FLAG_NO_SPATIALIZATION. pinnedListenerIndex: u8, }
Related Procedures With Parameters
Related Procedures With Returns
engine_node_type ¶
engine_node_type :: enum i32 { sound, group, }
Related Procedures With Parameters
enum_devices_callback_proc ¶
enum_devices_callback_proc :: proc "c" (pContext: ^context_type, deviceType: device_type, pInfo: ^device_info, pUserData: rawptr) -> b32
The callback for handling device enumeration. This is fired from ma_context_enumerate_devices()
.
Parameters ---------- pContext (in)
A pointer to the context performing the enumeration.
deviceType (in)
The type of the device being enumerated. This will always be either `ma_device_type_playback` or `ma_device_type_capture`.
pInfo (in)
A pointer to a `ma_device_info` containing the ID and name of the enumerated device. Note that this will not include detailed information about the device, only basic information (ID and name). The reason for this is that it would otherwise require opening the backend device to probe for the information which is too inefficient.
pUserData (in)
The user data pointer passed into `ma_context_enumerate_devices()`.
Related Procedures With Parameters
fader ¶
fader :: struct { config: fader_config, volumeBeg: f32, // If volumeBeg and volumeEnd is equal to 1, no fading happens (ma_fader_process_pcm_frames() will run as a passthrough). volumeEnd: f32, lengthInFrames: u64, // The total length of the fade. cursorInFrames: i64, }
Related Procedures With Parameters
fence ¶
fence :: struct { e: event, counter: struct {}, }
Fence ===== This locks while the counter is larger than 0. Counter can be incremented and decremented by any thread, but care needs to be taken when waiting. It is possible for one thread to acquire the fence just as another thread returns from ma_fence_wait().
The idea behind a fence is to allow you to wait for a group of operations to complete. When an operation starts, the counter is incremented which locks the fence. When the operation completes, the fence will be released which decrements the counter. ma_fence_wait() will block until the counter hits zero.
If threading is disabled, ma_fence_wait() will spin on the counter.
Related Procedures With Parameters
format ¶
format :: enum i32 { // I like to keep these explicitly defined because they're used as a key into a lookup table. When items are // added to this, make sure there are no gaps and that they're added to the lookup table in ma_get_bytes_per_sample(). unknown = 0, // Mainly used for indicating an error, but also used as the default for the output format for decoders. u8 = 1, s16 = 2, // Seems to be the most widely supported format. s24 = 3, // Tightly packed. 3 bytes per sample. s32 = 4, f32 = 5, }
Related Procedures With Parameters
- apply_volume_factor_pcm_frames
- audio_buffer_config_init
- audio_buffer_ref_init
- biquad_config_init
- bpf2_config_init
- bpf_config_init
- channel_converter_config_init
- clip_pcm_frames
- convert_frames
- convert_pcm_frames_format
- copy_and_apply_volume_factor_pcm_frames
- copy_pcm_frames
- data_converter_config_init
- data_source_get_data_format
- decoder_config_init
- decoder_get_data_format
- decoding_backend_config_init
- deinterleave_pcm_frames
- duplex_rb_init
- encoder_config_init
- fader_config_init
- fader_get_data_format
- get_bytes_per_frame
- get_bytes_per_sample
- get_format_name
- hishelf2_config_init
- hpf1_config_init
- hpf2_config_init
- hpf_config_init
- interleave_pcm_frames
- linear_resampler_config_init
- loshelf2_config_init
- lpf1_config_init
- lpf2_config_init
- lpf_config_init
- ma_copy_and_apply_volume_and_clip_pcm_frames
- noise_config_init
- notch2_config_init
- offset_pcm_frames_const_ptr
- offset_pcm_frames_ptr
- paged_audio_buffer_data_init
- panner_config_init
- pcm_convert
- pcm_rb_init
- pcm_rb_init_ex
- peak2_config_init
- pulsewave_config_init
- resampler_config_init
- resource_manager_data_buffer_get_data_format
- resource_manager_data_source_get_data_format
- resource_manager_data_stream_get_data_format
- resource_manager_register_decoded_data
- resource_manager_register_decoded_data_w
- silence_pcm_frames
- sound_get_data_format
- waveform_config_init
Related Procedures With Returns
gainer ¶
gainer :: struct { config: gainer_config, t: u32, masterVolume: f32, pOldGains: [^]f32, pNewGains: [^]f32, // Memory management. _pHeap: rawptr, _ownsHeap: b32, }
Related Procedures With Parameters
gainer_config ¶
Gainer for smooth volume changes.
Related Procedures With Parameters
Related Procedures With Returns
handedness ¶
handedness :: enum i32 { right, left, }
hishelf2_config ¶
hishelf2_config :: hishelf_config
hishelf_config ¶
hishelf_config :: struct { format: format, channels: u32, sampleRate: u32, gainDB: f64, shelfSlope: f64, frequency: f64, }
*********************************
High Shelf Filter
*********************************
Related Procedures With Parameters
Related Procedures With Returns
hishelf_node ¶
Related Procedures With Parameters
hishelf_node_config ¶
hishelf_node_config :: struct { nodeConfig: node_config, hishelf: hishelf_config, }
High Shelf Filter Node
Related Procedures With Parameters
Related Procedures With Returns
hpf ¶
hpf :: struct { format: format, channels: u32, sampleRate: u32, hpf1Count: u32, hpf2Count: u32, pHPF1: ^hpf1, pHPF2: ^hpf2, // Memory management. _pHeap: rawptr, _ownsHeap: b32, }
Related Procedures With Parameters
hpf1 ¶
hpf1 :: struct { format: format, channels: u32, a: biquad_coefficient, pR1: ^biquad_coefficient, // Memory management. _pHeap: rawptr, _ownsHeap: b32, }
Related Procedures With Parameters
hpf1_config ¶
hpf1_config :: struct { format: format, channels: u32, sampleRate: u32, cutoffFrequency: f64, q: f64, }
*********************************
High-Pass Filtering
*********************************
Related Procedures With Parameters
- hpf1_get_heap_size
- hpf1_init
- hpf1_init_preallocated
- hpf1_reinit
- hpf2_get_heap_size
- hpf2_init
- hpf2_init_preallocated
- hpf2_reinit
Related Procedures With Returns
hpf2_config ¶
hpf2_config :: hpf1_config
hpf_config ¶
hpf_config :: struct { format: format, channels: u32, sampleRate: u32, cutoffFrequency: f64, order: u32, }
Related Procedures With Parameters
Related Procedures With Returns
hpf_node ¶
Related Procedures With Parameters
hpf_node_config ¶
hpf_node_config :: struct { nodeConfig: node_config, hpf: hpf_config, }
High Pass Filter Node
Related Procedures With Parameters
Related Procedures With Returns
ios_session_category ¶
ios_session_category :: enum i32 { default = 0, // AVAudioSessionCategoryPlayAndRecord. none, // Leave the session category unchanged. ambient, // AVAudioSessionCategoryAmbient solo_ambient, // AVAudioSessionCategorySoloAmbient playback, // AVAudioSessionCategoryPlayback record, // AVAudioSessionCategoryRecord play_and_record, // AVAudioSessionCategoryPlayAndRecord multi_route, // AVAudioSessionCategoryMultiRoute }
iOS/tvOS/watchOS session categories.
ios_session_category_option ¶
ios_session_category_option :: enum i32 { mix_with_others = 1, // AVAudioSessionCategoryOptionMixWithOthers duck_others = 2, // AVAudioSessionCategoryOptionDuckOthers allow_bluetooth = 4, // AVAudioSessionCategoryOptionAllowBluetooth default_to_speaker = 8, // AVAudioSessionCategoryOptionDefaultToSpeaker interrupt_spoken_audio_and_mix_with_others = 17, // AVAudioSessionCategoryOptionInterruptSpokenAudioAndMixWithOthers allow_bluetooth_a2dp = 32, // AVAudioSessionCategoryOptionAllowBluetoothA2DP allow_air_play = 64, // AVAudioSessionCategoryOptionAllowAirPlay }
iOS/tvOS/watchOS session category options
job ¶
job :: struct { toc: struct #raw_union { // 8 bytes. We encode the job code into the slot allocation data to save space. breakup: struct { code: u16, // Job type. slot: u16, // Index into a ma_slot_allocator. refcount: u32, }, allocation: u64, }, next: u64, // atomic // refcount + slot for the next item. Does not include the job code. order: u32, // Execution order. Used to create a data dependency and ensure a job is executed in order. Usage is contextual depending on the job type. data: struct #raw_union { // Miscellaneous. custom: struct { proc_: job_proc, data0: uintptr, data1: uintptr, }, // Resource Manager resourceManager: struct #raw_union { loadDataBufferNode: struct { pResourceManager: rawptr, pDataBufferNode: rawptr, pFilePath: cstring, pFilePathW: [^]u16, flags: u32, // Resource manager data source flags that were used when initializing the data buffer. pInitNotification: ^async_notification, // Signalled when the data buffer has been initialized and the format/channels/rate can be retrieved. pDoneNotification: ^async_notification, // Signalled when the data buffer has been fully decoded. Will be passed through to MA_JOB_TYPE_RESOURCE_MANAGER_PAGE_DATA_BUFFER_NODE when decoding. pInitFence: ^fence, // Released when initialization of the decoder is complete. pDoneFence: ^fence, }, freeDataBufferNode: struct { pResourceManager: rawptr, pDataBufferNode: rawptr, pDoneNotification: ^async_notification, pDoneFence: ^fence, }, pageDataBufferNode: struct { pResourceManager: rawptr, pDataBufferNode: rawptr, pDecoder: rawptr, pDoneNotification: ^async_notification, // Signalled when the data buffer has been fully decoded. pDoneFence: ^fence, }, loadDataBuffer: struct { pDataBuffer: rawptr, pInitNotification: ^async_notification, // Signalled when the data buffer has been initialized and the format/channels/rate can be retrieved. pDoneNotification: ^async_notification, // Signalled when the data buffer has been fully decoded. pInitFence: ^fence, // Released when the data buffer has been initialized and the format/channels/rate can be retrieved. pDoneFence: ^fence, // Released when the data buffer has been fully decoded. rangeBegInPCMFrames: u64, rangeEndInPCMFrames: u64, loopPointBegInPCMFrames: u64, loopPointEndInPCMFrames: u64, isLooping: u32, }, freeDataBuffer: struct { pDataBuffer: rawptr, pDoneNotification: ^async_notification, pDoneFence: ^fence, }, loadDataStream: struct { pDataStream: rawptr, pFilePath: cstring, // Allocated when the job is posted, freed by the job thread after loading. pFilePathW: [^]u16, // ^ As above ^. Only used if pFilePath is NULL. initialSeekPoint: u64, pInitNotification: ^async_notification, // Signalled after the first two pages have been decoded and frames can be read from the stream. pInitFence: ^fence, }, freeDataStream: struct { pDataStream: rawptr, pDoneNotification: ^async_notification, pDoneFence: ^fence, }, pageDataStream: struct { pDataStream: rawptr, pageIndex: u32, }, seekDataStream: struct { pDataStream: rawptr, frameIndex: u64, }, }, // Device. device: struct { aaudio: struct { reroute: struct { pDevice: rawptr, deviceType: u32, }, }, }, }, }
Related Procedures With Parameters
- device_job_thread_next
- device_job_thread_post
- job_process
- job_queue_next
- job_queue_post
- resource_manager_next_job
- resource_manager_post_job
- resource_manager_process_job
Related Procedures With Returns
job_proc ¶
job_proc :: proc "c" (pJob: ^job)
Callback for processing a job. Each job type will have their own processing callback which will be called by ma_job_process().
job_queue ¶
job_queue :: struct { flags: u32, // Flags passed in at initialization time. capacity: u32, // The maximum number of jobs that can fit in the queue at a time. Set by the config. head: u64, // atomic // The first item in the list. Required for removing from the top of the list. tail: u64, // atomic // The last item in the list. Required for appending to the end of the list. sem: semaphore, // Only used when MA_JOB_QUEUE_FLAG_NON_BLOCKING is unset. allocator: slot_allocator, pJobs: [^]job, lock: spinlock, // Memory management. _pHeap: rawptr, _ownsHeap: b32, }
Related Procedures With Parameters
job_queue_flags ¶
job_queue_flags :: enum i32 { NON_BLOCKING = 1, }
When set, ma_job_queue_next() will not wait and no semaphore will be signaled in ma_job_queue_post(). ma_job_queue_next() will return MA_NO_DATA_AVAILABLE if nothing is available.
This flag should always be used for platforms that do not support multithreading.
Related Constants
job_type ¶
job_type :: enum i32 { // Miscellaneous. QUIT = 0, CUSTOM, // Resource Manager. RESOURCE_MANAGER_LOAD_DATA_BUFFER_NODE, RESOURCE_MANAGER_FREE_DATA_BUFFER_NODE, RESOURCE_MANAGER_PAGE_DATA_BUFFER_NODE, RESOURCE_MANAGER_LOAD_DATA_BUFFER, RESOURCE_MANAGER_FREE_DATA_BUFFER, RESOURCE_MANAGER_LOAD_DATA_STREAM, RESOURCE_MANAGER_FREE_DATA_STREAM, RESOURCE_MANAGER_PAGE_DATA_STREAM, RESOURCE_MANAGER_SEEK_DATA_STREAM, // Device. DEVICE_AAUDIO_REROUTE, // Count. Must always be last. COUNT, }
When a job type is added here an callback needs to be added go "g_jobVTable" in the implementation section.
linear_resampler ¶
linear_resampler :: struct { config: linear_resampler_config, inAdvanceInt: u32, inAdvanceFrac: u32, inTimeInt: u32, inTimeFrac: u32, x0: struct #raw_union { f32: [^]f32, s16: [^]i16, }, // The previous input frame. x1: struct #raw_union { f32: [^]f32, s16: [^]i16, }, // The next input frame. lpf: lpf, // Memory management. _pHeap: rawptr, _ownsHeap: b32, }
Related Procedures With Parameters
- linear_resampler_get_expected_output_frame_count
- linear_resampler_get_input_latency
- linear_resampler_get_output_latency
- linear_resampler_get_required_input_frame_count
- linear_resampler_init
- linear_resampler_init_preallocated
- linear_resampler_process_pcm_frames
- linear_resampler_reset
- linear_resampler_set_rate
- linear_resampler_set_rate_ratio
- linear_resampler_uninit
linear_resampler_config ¶
linear_resampler_config :: struct { format: format, channels: u32, sampleRateIn: u32, sampleRateOut: u32, lpfOrder: u32, // The low-pass filter order. Setting this to 0 will disable low-pass filtering. lpfNyquistFactor: f64, }
*********************************
Resampling
*********************************
Related Procedures With Parameters
Related Procedures With Returns
log ¶
log :: struct { callbacks: [4]log_callback, callbackCount: u32, allocationCallbacks: allocation_callbacks, // Need to store these persistently because log_postv() might need to allocate a buffer on the heap. lock: mutex, }
Related Procedures With Parameters
Related Procedures With Returns
log_callback ¶
log_callback :: struct { onLog: log_callback_proc, pUserData: rawptr, }
Related Procedures With Parameters
Related Procedures With Returns
log_callback_proc ¶
The callback for handling log messages.
Parameters ---------- pUserData (in) The user data pointer that was passed into ma_log_register_callback().
logLevel (in) The log level. This can be one of the following:
+----------------------+ | Log Level | +----------------------+ | MA_LOG_LEVEL_DEBUG | | MA_LOG_LEVEL_INFO | | MA_LOG_LEVEL_WARNING | | MA_LOG_LEVEL_ERROR | +----------------------+
pMessage (in) The log message.
Related Procedures With Parameters
log_level ¶
log_level :: enum i32 { LOG_LEVEL_DEBUG = 4, LOG_LEVEL_INFO = 3, LOG_LEVEL_WARNING = 2, LOG_LEVEL_ERROR = 1, }
loshelf2_config ¶
loshelf2_config :: loshelf_config
loshelf_config ¶
loshelf_config :: struct { format: format, channels: u32, sampleRate: u32, gainDB: f64, shelfSlope: f64, frequency: f64, }
*********************************
Low Shelf Filter
*********************************
Related Procedures With Parameters
Related Procedures With Returns
loshelf_node ¶
Related Procedures With Parameters
loshelf_node_config ¶
loshelf_node_config :: struct { nodeConfig: node_config, loshelf: loshelf_config, }
Low Shelf Filter Node
Related Procedures With Parameters
Related Procedures With Returns
lpf ¶
lpf :: struct { format: format, channels: u32, sampleRate: u32, lpf1Count: u32, lpf2Count: u32, pLPF1: ^lpf1, pLPF2: ^lpf2, // Memory management. _pHeap: rawptr, _ownsHeap: b32, }
Related Procedures With Parameters
lpf1 ¶
lpf1 :: struct { format: format, channels: u32, a: biquad_coefficient, pR1: ^biquad_coefficient, // Memory management. _pHeap: rawptr, _ownsHeap: b32, }
Related Procedures With Parameters
lpf1_config ¶
lpf1_config :: struct { format: format, channels: u32, sampleRate: u32, cutoffFrequency: f64, q: f64, }
*********************************
Low-Pass Filtering
*********************************
Related Procedures With Parameters
- lpf1_get_heap_size
- lpf1_init
- lpf1_init_preallocated
- lpf1_reinit
- lpf2_get_heap_size
- lpf2_init
- lpf2_init_preallocated
- lpf2_reinit
Related Procedures With Returns
lpf2_config ¶
lpf2_config :: lpf1_config
lpf_config ¶
lpf_config :: struct { format: format, channels: u32, sampleRate: u32, cutoffFrequency: f64, order: u32, }
Related Procedures With Parameters
Related Procedures With Returns
lpf_node ¶
Related Procedures With Parameters
lpf_node_config ¶
lpf_node_config :: struct { nodeConfig: node_config, lpf: lpf_config, }
Low Pass Filter Node
Related Procedures With Parameters
Related Procedures With Returns
ma_seek_proc ¶
ma_seek_proc :: proc "c" (pUserData: rawptr, offset: i64, origin: seek_origin) -> result
mono_expansion_mode ¶
mono_expansion_mode :: enum i32 { duplicate = 0, // The default. average, // Average the mono channel across all channels. stereo_only, // Duplicate to the left and right channels only and ignore the others. default = 0, }
node ¶
node :: struct {}
Related Procedures With Parameters
- engine_play_sound_ex
- node_attach_output_bus
- node_detach_all_output_buses
- node_detach_output_bus
- node_get_input_bus_count
- node_get_input_channels
- node_get_node_graph
- node_get_output_bus_count
- node_get_output_bus_volume
- node_get_output_channels
- node_get_state
- node_get_state_by_time
- node_get_state_by_time_range
- node_get_state_time
- node_get_time
- node_init
- node_init_preallocated
- node_set_output_bus_volume
- node_set_state
- node_set_state_time
- node_set_time
- node_uninit
Related Procedures With Returns
node_base ¶
node_base :: struct { // These variables are set once at startup. pNodeGraph: ^node_graph, // The graph this node belongs to. vtable: ^node_vtable, pCachedData: [^]f32, // Allocated on the heap. Fixed size. Needs to be stored on the heap because reading from output buses is done in separate function calls. cachedDataCapInFramesPerBus: u16, // These variables are read and written only from the audio thread. cachedFrameCountOut: u16, cachedFrameCountIn: u16, consumedFrameCountIn: u16, // These variables are read and written between different threads. state: node_state, // atomic // When set to stopped, nothing will be read, regardless of the times in stateTimes. stateTimes: [2]u64, // atomic // Indexed by ma_node_state. Specifies the time based on the global clock that a node should be considered to be in the relevant state. localTime: u64, // atomic // The node's local clock. This is just a running sum of the number of output frames that have been processed. Can be modified by any thread with `ma_node_set_time()`. inputBusCount: u32, outputBusCount: u32, pInputBuses: [^]node_input_bus, pOutputBuses: [^]node_output_bus, // Memory management. _inputBuses: [2]node_input_bus, _outputBuses: [2]node_output_bus, _pHeap: rawptr, // A heap allocation for internal use only. pInputBuses and/or pOutputBuses will point to this if the bus count exceeds MA_MAX_NODE_LOCAL_BUS_COUNT. _ownsHeap: b32, }
node_config ¶
node_config :: struct { vtable: ^node_vtable, // Should never be null. Initialization of the node will fail if so. initialState: node_state, // Defaults to ma_node_state_started. inputBusCount: u32, // Only used if the vtable specifies an input bus count of `MA_NODE_BUS_COUNT_UNKNOWN`, otherwise must be set to `MA_NODE_BUS_COUNT_UNKNOWN` (default). outputBusCount: u32, // Only used if the vtable specifies an output bus count of `MA_NODE_BUS_COUNT_UNKNOWN`, otherwise be set to `MA_NODE_BUS_COUNT_UNKNOWN` (default). pInputChannels: ^u32, // The number of elements are determined by the input bus count as determined by the vtable, or `inputBusCount` if the vtable specifies `MA_NODE_BUS_COUNT_UNKNOWN`. pOutputChannels: ^u32, }
Related Procedures With Parameters
Related Procedures With Returns
node_flags ¶
node_flags :: enum i32 { PASSTHROUGH = 1, CONTINUOUS_PROCESSING = 2, ALLOW_NULL_INPUT = 4, DIFFERENT_PROCESSING_RATES = 8, SILENT_OUTPUT = 16, }
Node flags.
node_graph ¶
node_graph :: struct { // Immutable. base: node_base, // The node graph itself is a node so it can be connected as an input to different node graph. This has zero inputs and calls ma_node_graph_read_pcm_frames() to generate it's output. endpoint: node_base, // Special node that all nodes eventually connect to. Data is read from this node in ma_node_graph_read_pcm_frames(). nodeCacheCapInFrames: u16, // Read and written by multiple threads. isReading: b32, }
Related Procedures With Parameters
- biquad_node_init
- bpf_node_init
- data_source_node_init
- delay_node_init
- hishelf_node_init
- hpf_node_init
- loshelf_node_init
- lpf_node_init
- node_get_heap_size
- node_graph_get_channels
- node_graph_get_endpoint
- node_graph_get_time
- node_graph_init
- node_graph_read_pcm_frames
- node_graph_set_time
- node_graph_uninit
- node_init
- node_init_preallocated
- notch_node_init
- peak_node_init
- splitter_node_init
Related Procedures With Returns
node_input_bus ¶
node_input_bus :: struct { // Mutable via multiple threads. head: node_output_bus, // Dummy head node for simplifying some lock-free thread-safety stuff. nextCounter: u32, // atomic // This is used to determine whether or not the input bus is finding the next node in the list. Used for thread safety when detaching output buses. lock: spinlock, // Set once at startup. channels: u8, }
A node has multiple input buses. The output buses of a node are connecting to the input busses of another. An input bus is essentially just a linked list of output buses.
node_output_bus ¶
node_output_bus :: struct { // Immutable. pNode: ^node, // The node that owns this output bus. The input node. Will be null for dummy head and tail nodes. outputBusIndex: u8, // The index of the output bus on pNode that this output bus represents. channels: u8, // Mutable via multiple threads. Must be used atomically. The weird ordering here is for packing reasons. inputNodeInputBusIndex: u8, // The index of the input bus on the input. Required for detaching. Will only be used in the spinlock so does not need to be atomic. flags: u32, // atomic // Some state flags for tracking the read state of the output buffer. A combination of MA_NODE_OUTPUT_BUS_FLAG_*. refCount: u32, // atomic // Reference count for some thread-safety when detaching. isAttached: b32, // atomic // This is used to prevent iteration of nodes that are in the middle of being detached. Used for thread safety. lock: spinlock, // atomic // Unfortunate lock, but significantly simplifies the implementation. Required for thread-safe attaching and detaching. volume: f32, // atomic // Linear. pNext: ^node_output_bus, // atomic // If null, it's the tail node or detached. pPrev: ^node_output_bus, // atomic // If null, it's the head node or detached. pInputNode: ^node, }
A node has multiple output buses. An output bus is attached to an input bus as an item in a linked list. Think of the input bus as a linked list, with the output bus being an item in that list.
node_state ¶
node_state :: enum i32 { started = 0, stopped = 1, }
The playback state of a node. Either started or stopped.
Related Procedures With Parameters
Related Procedures With Returns
node_vtable ¶
node_vtable :: struct { // Extended processing callback. This callback is used for effects that process input and output // at different rates (i.e. they perform resampling). This is similar to the simple version, only // they take two separate frame counts: one for input, and one for output. // // On input, `pFrameCountOut` is equal to the capacity of the output buffer for each bus, whereas // `pFrameCountIn` will be equal to the number of PCM frames in each of the buffers in `ppFramesIn`. // // On output, set `pFrameCountOut` to the number of PCM frames that were actually output and set // `pFrameCountIn` to the number of input frames that were consumed. onProcess: proc "c" (pNode: ^node, ppFramesIn: ^[^]f32, pFrameCountIn: ^u32, ppFramesOut: ^[^]f32, pFrameCountOut: ^u32), // A callback for retrieving the number of a input frames that are required to output the // specified number of output frames. You would only want to implement this when the node performs // resampling. This is optional, even for nodes that perform resampling, but it does offer a // small reduction in latency as it allows miniaudio to calculate the exact number of input frames // to read at a time instead of having to estimate. onGetRequiredInputFrameCount: proc "c" (pNode: ^node, outputFrameCount: u32, pInputFrameCount: ^u32) -> result, // The number of input buses. This is how many sub-buffers will be contained in the `ppFramesIn` // parameters of the callbacks above. inputBusCount: u8, // The number of output buses. This is how many sub-buffers will be contained in the `ppFramesOut` // parameters of the callbacks above. outputBusCount: u8, // Flags describing characteristics of the node. This is currently just a placeholder for some // ideas for later on. flags: u32, }
noise ¶
noise :: struct { ds: data_source_base, config: noise_config, lcg: lcg, state: struct #raw_union { pink: struct { bin: ^[^]f64, accumulation: [^]f64, counter: [^]u32, }, brownian: struct { accumulation: [^]f64, }, }, // Memory management. _pHeap: rawptr, _ownsHeap: b32, }
Related Procedures With Parameters
noise_config ¶
noise_config :: struct { format: format, channels: u32, type: noise_type, seed: i32, amplitude: f64, duplicateChannels: b32, }
Related Procedures With Parameters
Related Procedures With Returns
notch2_config ¶
notch2_config :: notch_config
notch_config ¶
*********************************
Notching Filter
*********************************
Related Procedures With Parameters
Related Procedures With Returns
notch_node ¶
Related Procedures With Parameters
notch_node_config ¶
notch_node_config :: struct { nodeConfig: node_config, notch: notch_config, }
Notching Filter Node
Related Procedures With Parameters
Related Procedures With Returns
open_mode_flags ¶
open_mode_flags :: enum i32 { READ = 1, WRITE = 2, }
opensl_recording_preset ¶
opensl_recording_preset :: enum i32 { default = 0, // Leaves the input preset unset. generic, // SL_ANDROID_RECORDING_PRESET_GENERIC camcorder, // SL_ANDROID_RECORDING_PRESET_CAMCORDER voice_recognition, // SL_ANDROID_RECORDING_PRESET_VOICE_RECOGNITION voice_communication, // SL_ANDROID_RECORDING_PRESET_VOICE_COMMUNICATION voice_unprocessed, // SL_ANDROID_RECORDING_PRESET_UNPROCESSED }
OpenSL recording presets.
opensl_stream_type ¶
opensl_stream_type :: enum i32 { default = 0, // Leaves the stream type unset. voice, // SL_ANDROID_STREAM_VOICE system, // SL_ANDROID_STREAM_SYSTEM ring, // SL_ANDROID_STREAM_RING media, // SL_ANDROID_STREAM_MEDIA alarm, // SL_ANDROID_STREAM_ALARM notification, // SL_ANDROID_STREAM_NOTIFICATION }
OpenSL stream types.
paged_audio_buffer ¶
paged_audio_buffer :: struct { ds: data_source_base, pData: ^paged_audio_buffer_data, // Audio data is read from here. Cannot be null. pCurrent: ^paged_audio_buffer_page, relativeCursor: u64, // Relative to the current page. absoluteCursor: u64, }
Related Procedures With Parameters
paged_audio_buffer_config ¶
paged_audio_buffer_config :: struct { pData: ^paged_audio_buffer_data, }
Related Procedures With Parameters
Related Procedures With Returns
paged_audio_buffer_data ¶
paged_audio_buffer_data :: struct { format: format, channels: u32, head: paged_audio_buffer_page, // Dummy head for the lock-free algorithm. Always has a size of 0. pTail: ^paged_audio_buffer_page, }
Related Procedures With Parameters
- paged_audio_buffer_config_init
- paged_audio_buffer_data_allocate_and_append_page
- paged_audio_buffer_data_allocate_page
- paged_audio_buffer_data_append_page
- paged_audio_buffer_data_free_page
- paged_audio_buffer_data_get_head
- paged_audio_buffer_data_get_length_in_pcm_frames
- paged_audio_buffer_data_get_tail
- paged_audio_buffer_data_init
- paged_audio_buffer_data_uninit
paged_audio_buffer_page ¶
paged_audio_buffer_page :: struct { pNext: ^paged_audio_buffer_page, // atomic sizeInFrames: u64, pAudioData: [1]u8, }
Paged Audio Buffer ================== A paged audio buffer is made up of a linked list of pages. It's expandable, but not shrinkable. It can be used for cases where audio data is streamed in asynchronously while allowing data to be read at the same time.
This is lock-free, but not 100% thread safe. You can append a page and read from the buffer across simultaneously across different threads, however only one thread at a time can append, and only one thread at a time can read and seek.
Related Procedures With Parameters
Related Procedures With Returns
pan_mode ¶
pan_mode :: enum i32 { balance = 0, // Does not blend one side with the other. Technically just a balance. Compatible with other popular audio engines and therefore the default. pan, // A true pan. The sound from one side will "move" to the other side and blend with it. }
Stereo panner.
Related Procedures With Parameters
Related Procedures With Returns
panner ¶
Related Procedures With Parameters
pcm_rb ¶
pcm_rb :: struct { ds: data_source_base, rb: rb, format: format, channels: u32, sampleRate: u32, }
Related Procedures With Parameters
- pcm_rb_acquire_read
- pcm_rb_acquire_write
- pcm_rb_available_read
- pcm_rb_available_write
- pcm_rb_commit_read
- pcm_rb_commit_write
- pcm_rb_get_channels
- pcm_rb_get_format
- pcm_rb_get_sample_rate
- pcm_rb_get_subbuffer_offset
- pcm_rb_get_subbuffer_ptr
- pcm_rb_get_subbuffer_size
- pcm_rb_get_subbuffer_stride
- pcm_rb_init
- pcm_rb_init_ex
- pcm_rb_pointer_distance
- pcm_rb_reset
- pcm_rb_seek_read
- pcm_rb_seek_write
- pcm_rb_set_sample_rate
- pcm_rb_uninit
peak2_config ¶
peak2_config :: peak_config
peak_config ¶
peak_config :: struct { format: format, channels: u32, sampleRate: u32, gainDB: f64, q: f64, frequency: f64, }
*********************************
Peaking EQ Filter
*********************************
Related Procedures With Parameters
Related Procedures With Returns
peak_node ¶
Related Procedures With Parameters
peak_node_config ¶
peak_node_config :: struct { nodeConfig: node_config, peak: peak_config, }
Peaking Filter Node
Related Procedures With Parameters
Related Procedures With Returns
performance_profile ¶
performance_profile :: enum i32 { low_latency = 0, conservative, }
Related Procedures With Parameters
positioning ¶
positioning :: enum i32 { absolute, relative, }
Related Procedures With Parameters
Related Procedures With Returns
pulsewave ¶
pulsewave :: struct { waveform: waveform, config: pulsewave_config, }
Related Procedures With Parameters
pulsewave_config ¶
pulsewave_config :: struct { format: format, channels: u32, sampleRate: u32, dutyCycle: f64, amplitude: f64, frequency: f64, }
Related Procedures With Parameters
Related Procedures With Returns
rb ¶
rb :: struct { pBuffer: rawptr, subbufferSizeInBytes: u32, subbufferCount: u32, subbufferStrideInBytes: u32, encodedReadOffset: u32, // atomic // Most significant bit is the loop flag. Lower 31 bits contains the actual offset in bytes. Must be used atomically. encodedWriteOffset: u32, // atomic // Most significant bit is the loop flag. Lower 31 bits contains the actual offset in bytes. Must be used atomically. ownsBuffer: b8, // Used to know whether or not miniaudio is responsible for free()-ing the buffer. clearOnWriteAcquire: b8, // When set, clears the acquired write buffer before returning from ma_rb_acquire_write(). allocationCallbacks: allocation_callbacks, }
*******************************
Ring Buffer
*******************************
Related Procedures With Parameters
resample_algorithm ¶
resample_algorithm :: enum i32 { linear = 0, // Fastest, lowest quality. Optional low-pass filtering. Default. custom, }
Related Procedures With Parameters
resampler ¶
resampler :: struct { pBackend: ^resampling_backend, pBackendVTable: ^resampling_backend_vtable, pBackendUserData: rawptr, format: format, channels: u32, sampleRateIn: u32, sampleRateOut: u32, state: struct { linear: linear_resampler, }, // Memory management. _pHeap: rawptr, _ownsHeap: b32, }
Related Procedures With Parameters
resampler_config ¶
resampler_config :: struct { format: format, // Must be either ma_format_f32 or ma_format_s16. channels: u32, sampleRateIn: u32, sampleRateOut: u32, algorithm: resample_algorithm, // When set to ma_resample_algorithm_custom, pBackendVTable will be used. pBackendVTable: ^resampling_backend_vtable, pBackendUserData: rawptr, linear: struct { lpfOrder: u32, }, }
Related Procedures With Parameters
Related Procedures With Returns
resampling_backend ¶
resampling_backend :: struct {}
resampling_backend_vtable ¶
resampling_backend_vtable :: struct { onGetHeapSize: proc "c" (pUserData: rawptr, pConfig: ^resampler_config, pHeapSizeInBytes: ^uint) -> result, onInit: proc "c" (pUserData: rawptr, pConfig: ^resampler_config, pHeap: rawptr, ppBackend: ^^resampling_backend) -> result, onUninit: proc "c" (pUserData: rawptr, pBackend: ^resampling_backend, pAllocationCallbacks: ^allocation_callbacks), onProcess: proc "c" (pUserData: rawptr, pBackend: ^resampling_backend, pFramesIn: rawptr, pFrameCountIn: ^u64, pFramesOut: rawptr, pFrameCountOut: ^u64) -> result, onSetRate: proc "c" (pUserData: rawptr, pBackend: ^resampling_backend, sampleRateIn: u32, sampleRateOut: u32) -> result, // Optional. Rate changes will be disabled. onGetInputLatency: proc "c" (pUserData: rawptr, pBackend: ^resampling_backend) -> u64, // Optional. Latency will be reported as 0. onGetOutputLatency: proc "c" (pUserData: rawptr, pBackend: ^resampling_backend) -> u64, // Optional. Latency will be reported as 0. onGetRequiredInputFrameCount: proc "c" (pUserData: rawptr, pBackend: ^resampling_backend, outputFrameCount: u64, pInputFrameCount: ^u64) -> result, // Optional. Latency mitigation will be disabled. onGetExpectedOutputFrameCount: proc "c" (pUserData: rawptr, pBackend: ^resampling_backend, inputFrameCount: u64, pOutputFrameCount: ^u64) -> result, // Optional. Latency mitigation will be disabled. onReset: proc "c" (pUserData: rawptr, pBackend: ^resampling_backend) -> result, }
resource_manager ¶
resource_manager :: struct { config: resource_manager_config, pRootDataBufferNode: ^resource_manager_data_buffer_node, // The root buffer in the binary tree. dataBufferBSTLock: mutex, // For synchronizing access to the data buffer binary tree. jobThreads: [64]thread, // The threads for executing jobs. jobQueue: job_queue, // Multi-consumer, multi-producer job queue for managing jobs for asynchronous decoding and streaming. defaultVFS: default_vfs, // Only used if a custom VFS is not specified. log: log, }
Related Procedures With Parameters
- resource_manager_data_buffer_init
- resource_manager_data_buffer_init_copy
- resource_manager_data_buffer_init_ex
- resource_manager_data_buffer_init_w
- resource_manager_data_source_init
- resource_manager_data_source_init_copy
- resource_manager_data_source_init_ex
- resource_manager_data_source_init_w
- resource_manager_data_stream_init
- resource_manager_data_stream_init_ex
- resource_manager_data_stream_init_w
- resource_manager_get_log
- resource_manager_init
- resource_manager_next_job
- resource_manager_post_job
- resource_manager_post_job_quit
- resource_manager_process_job
- resource_manager_process_next_job
- resource_manager_register_decoded_data
- resource_manager_register_decoded_data_w
- resource_manager_register_encoded_data
- resource_manager_register_encoded_data_w
- resource_manager_register_file
- resource_manager_register_file_w
- resource_manager_uninit
- resource_manager_unregister_data
- resource_manager_unregister_data_w
- resource_manager_unregister_file
- resource_manager_unregister_file_w
Related Procedures With Returns
resource_manager_config ¶
resource_manager_config :: struct { allocationCallbacks: allocation_callbacks, pLog: ^log, decodedFormat: format, // The decoded format to use. Set to ma_format_unknown (default) to use the file's native format. decodedChannels: u32, // The decoded channel count to use. Set to 0 (default) to use the file's native channel count. decodedSampleRate: u32, // the decoded sample rate to use. Set to 0 (default) to use the file's native sample rate. jobThreadCount: u32, // Set to 0 if you want to self-manage your job threads. Defaults to 1. jobThreadStackSize: uint, jobQueueCapacity: u32, // The maximum number of jobs that can fit in the queue at a time. Defaults to MA_JOB_TYPE_RESOURCE_MANAGER_QUEUE_CAPACITY. Cannot be zero. flags: u32, pVFS: ^vfs, // Can be NULL in which case defaults will be used. ppCustomDecodingBackendVTables: ^[^]decoding_backend_vtable, customDecodingBackendCount: u32, pCustomDecodingBackendUserData: rawptr, }
Related Procedures With Parameters
Related Procedures With Returns
resource_manager_data_buffer ¶
resource_manager_data_buffer :: struct { ds: data_source_base, // Base data source. A data buffer is a data source. pResourceManager: ^resource_manager, // A pointer to the resource manager that owns this buffer. pNode: ^resource_manager_data_buffer_node, // The data node. This is reference counted and is what supplies the data. flags: u32, // The flags that were passed used to initialize the buffer. executionCounter: u32, // atomic // For allocating execution orders for jobs. executionPointer: u32, // atomic // For managing the order of execution for asynchronous jobs relating to this object. Incremented as jobs complete processing. seekTargetInPCMFrames: u64, // Only updated by the public API. Never written nor read from the job thread. seekToCursorOnNextRead: b32, // On the next read we need to seek to the frame cursor. result: result, // atomic // Keeps track of a result of decoding. Set to MA_BUSY while the buffer is still loading. Set to MA_SUCCESS when loading is finished successfully. Otherwise set to some other code. isLooping: b32, // atomic // Can be read and written by different threads at the same time. Must be used atomically. isConnectorInitialized: b32, // Used for asynchronous loading to ensure we don't try to initialize the connector multiple times while waiting for the node to fully load. connector: struct #raw_union { decoder: decoder, // Supply type is ma_resource_manager_data_supply_type_encoded buffer: audio_buffer, // Supply type is ma_resource_manager_data_supply_type_decoded pagedBuffer: paged_audio_buffer, }, }
Related Procedures With Parameters
- resource_manager_data_buffer_get_available_frames
- resource_manager_data_buffer_get_cursor_in_pcm_frames
- resource_manager_data_buffer_get_data_format
- resource_manager_data_buffer_get_length_in_pcm_frames
- resource_manager_data_buffer_init
- resource_manager_data_buffer_init_copy
- resource_manager_data_buffer_init_ex
- resource_manager_data_buffer_init_w
- resource_manager_data_buffer_is_looping
- resource_manager_data_buffer_read_pcm_frames
- resource_manager_data_buffer_result
- resource_manager_data_buffer_seek_to_pcm_frame
- resource_manager_data_buffer_set_looping
- resource_manager_data_buffer_uninit
resource_manager_data_buffer_node ¶
resource_manager_data_buffer_node :: struct { hashedName32: u32, // The hashed name. This is the key. refCount: u32, result: result, // atomic // Result from asynchronous loading. When loading set to MA_BUSY. When fully loaded set to MA_SUCCESS. When deleting set to MA_UNAVAILABLE. executionCounter: u32, // atomic // For allocating execution orders for jobs. executionPointer: u32, // atomic // For managing the order of execution for asynchronous jobs relating to this object. Incremented as jobs complete processing. isDataOwnedByResourceManager: b32, // Set to true when the underlying data buffer was allocated the resource manager. Set to false if it is owned by the application (via ma_resource_manager_register_*()). data: resource_manager_data_supply, pParent: ^resource_manager_data_buffer_node, pChildLo: ^resource_manager_data_buffer_node, pChildHi: ^resource_manager_data_buffer_node, }
resource_manager_data_source ¶
resource_manager_data_source :: struct { backend: struct #raw_union { buffer: resource_manager_data_buffer, stream: resource_manager_data_stream, }, // Must be the first item because we need the first item to be the data source callbacks for the buffer or stream. flags: u32, // The flags that were passed in to ma_resource_manager_data_source_init(). executionCounter: u32, // atomic // For allocating execution orders for jobs. executionPointer: u32, }
Related Procedures With Parameters
- resource_manager_data_source_get_available_frames
- resource_manager_data_source_get_cursor_in_pcm_frames
- resource_manager_data_source_get_data_format
- resource_manager_data_source_get_length_in_pcm_frames
- resource_manager_data_source_init
- resource_manager_data_source_init_copy
- resource_manager_data_source_init_ex
- resource_manager_data_source_init_w
- resource_manager_data_source_is_looping
- resource_manager_data_source_read_pcm_frames
- resource_manager_data_source_result
- resource_manager_data_source_seek_to_pcm_frame
- resource_manager_data_source_set_looping
- resource_manager_data_source_uninit
resource_manager_data_source_config ¶
resource_manager_data_source_config :: struct { pFilePath: cstring, pFilePathW: [^]u16, pNotifications: ^resource_manager_pipeline_notifications, initialSeekPointInPCMFrames: u64, rangeBegInPCMFrames: u64, rangeEndInPCMFrames: u64, loopPointBegInPCMFrames: u64, loopPointEndInPCMFrames: u64, isLooping: b32, flags: u32, }
Related Procedures With Parameters
- resource_manager_data_buffer_init_ex
- resource_manager_data_source_init_ex
- resource_manager_data_stream_init_ex
Related Procedures With Returns
resource_manager_data_source_flags ¶
resource_manager_data_source_flags :: enum i32 { STREAM = 1, // When set, does not load the entire data source in memory. Disk I/O will happen on job threads. DECODE = 2, // Decode data before storing in memory. When set, decoding is done at the resource manager level rather than the mixing thread. Results in faster mixing, but higher memory usage. ASYNC = 4, // When set, the resource manager will load the data source asynchronously. WAIT_INIT = 8, // When set, waits for initialization of the underlying data source before returning from ma_resource_manager_data_source_init(). UNKNOWN_LENGTH = 16, // Gives the resource manager a hint that the length of the data source is unknown and calling `ma_data_source_get_length_in_pcm_frames()` should be avoided. }
resource_manager_data_stream ¶
resource_manager_data_stream :: struct { ds: data_source_base, // Base data source. A data stream is a data source. pResourceManager: ^resource_manager, // A pointer to the resource manager that owns this data stream. flags: u32, // The flags that were passed used to initialize the stream. decoder: decoder, // Used for filling pages with data. This is only ever accessed by the job thread. The public API should never touch this. isDecoderInitialized: b32, // Required for determining whether or not the decoder should be uninitialized in MA_JOB_TYPE_RESOURCE_MANAGER_FREE_DATA_STREAM. totalLengthInPCMFrames: u64, // This is calculated when first loaded by the MA_JOB_TYPE_RESOURCE_MANAGER_LOAD_DATA_STREAM. relativeCursor: u32, // The playback cursor, relative to the current page. Only ever accessed by the public API. Never accessed by the job thread. absoluteCursor: u64, // atomic // The playback cursor, in absolute position starting from the start of the file. currentPageIndex: u32, // Toggles between 0 and 1. Index 0 is the first half of pPageData. Index 1 is the second half. Only ever accessed by the public API. Never accessed by the job thread. executionCounter: u32, // atomic // For allocating execution orders for jobs. executionPointer: u32, // Written by the public API, read by the job thread. isLooping: b32, // Written by the job thread, read by the public API. pPageData: rawptr, // Buffer containing the decoded data of each page. Allocated once at initialization time. pageFrameCount: [2]u32, // Written and read by both the public API and the job thread. These must be atomic. result: result, // atomic // Result from asynchronous loading. When loading set to MA_BUSY. When initialized set to MA_SUCCESS. When deleting set to MA_UNAVAILABLE. If an error occurs when loading, set to an error code. isDecoderAtEnd: b32, // atomic // Whether or not the decoder has reached the end. isPageValid: [2]b32, // atomic // Booleans to indicate whether or not a page is valid. Set to false by the public API, set to true by the job thread. Set to false as the pages are consumed, true when they are filled. seekCounter: b32, }
Related Procedures With Parameters
- resource_manager_data_stream_get_available_frames
- resource_manager_data_stream_get_cursor_in_pcm_frames
- resource_manager_data_stream_get_data_format
- resource_manager_data_stream_get_length_in_pcm_frames
- resource_manager_data_stream_init
- resource_manager_data_stream_init_ex
- resource_manager_data_stream_init_w
- resource_manager_data_stream_is_looping
- resource_manager_data_stream_read_pcm_frames
- resource_manager_data_stream_result
- resource_manager_data_stream_seek_to_pcm_frame
- resource_manager_data_stream_set_looping
- resource_manager_data_stream_uninit
resource_manager_data_supply ¶
resource_manager_data_supply :: struct { type: resource_manager_data_supply_type, // atomic // Read and written from different threads so needs to be accessed atomically. backend: struct #raw_union { encoded: struct { pData: rawptr, sizeInBytes: uint, }, decoded: struct { pData: rawptr, totalFrameCount: u64, decodedFrameCount: u64, format: format, channels: u32, sampleRate: u32, }, decodedPaged: struct { data: paged_audio_buffer_data, decodedFrameCount: u64, sampleRate: u32, }, }, }
resource_manager_data_supply_type ¶
resource_manager_data_supply_type :: enum i32 { unknown = 0, // Used for determining whether or the data supply has been initialized. encoded, // Data supply is an encoded buffer. Connector is ma_decoder. decoded, // Data supply is a decoded buffer. Connector is ma_audio_buffer. decoded_paged, // Data supply is a linked list of decoded buffers. Connector is ma_paged_audio_buffer. }
resource_manager_flags ¶
resource_manager_flags :: enum i32 { // Indicates ma_resource_manager_next_job() should not block. Only valid when the job thread count is 0. NON_BLOCKING = 1, // Disables any kind of multithreading. Implicitly enables MA_RESOURCE_MANAGER_FLAG_NON_BLOCKING. NO_THREADING = 2, }
resource_manager_job ¶
resource_manager_job :: job
BEGIN BACKWARDS COMPATIBILITY TODO: Remove this block in version 0.12.
resource_manager_job_queue ¶
resource_manager_job_queue :: job_queue
resource_manager_job_queue_config ¶
resource_manager_job_queue_config :: job_queue_config
resource_manager_pipeline_notifications ¶
resource_manager_pipeline_notifications :: struct { init: resource_manager_pipeline_stage_notification, // Initialization of the decoder. done: resource_manager_pipeline_stage_notification, }
Related Procedures With Parameters
- resource_manager_data_buffer_init
- resource_manager_data_buffer_init_w
- resource_manager_data_source_init
- resource_manager_data_source_init_w
- resource_manager_data_stream_init
- resource_manager_data_stream_init_w
Related Procedures With Returns
resource_manager_pipeline_stage_notification ¶
resource_manager_pipeline_stage_notification :: struct { pNotification: ^async_notification, pFence: ^fence, }
Pipeline notifications used by the resource manager. Made up of both an async notification and a fence, both of which are optional.
result ¶
result :: enum i32 { SUCCESS = 0, ERROR = -1, // A generic error. INVALID_ARGS = -2, INVALID_OPERATION = -3, OUT_OF_MEMORY = -4, OUT_OF_RANGE = -5, ACCESS_DENIED = -6, DOES_NOT_EXIST = -7, ALREADY_EXISTS = -8, TOO_MANY_OPEN_FILES = -9, INVALID_FILE = -01, TOO_BIG = -11, PATH_TOO_LONG = -21, NAME_TOO_LONG = -31, NOT_DIRECTORY = -41, IS_DIRECTORY = -51, DIRECTORY_NOT_EMPTY = -61, AT_END = -71, NO_SPACE = -81, BUSY = -91, IO_ERROR = -02, INTERRUPT = -12, UNAVAILABLE = -22, ALREADY_IN_USE = -32, BAD_ADDRESS = -42, BAD_SEEK = -52, BAD_PIPE = -62, DEADLOCK = -72, TOO_MANY_LINKS = -82, NOT_IMPLEMENTED = -92, NO_MESSAGE = -03, BAD_MESSAGE = -13, NO_DATA_AVAILABLE = -23, INVALID_DATA = -33, TIMEOUT = -43, NO_NETWORK = -53, NOT_UNIQUE = -63, NOT_SOCKET = -73, NO_ADDRESS = -83, BAD_PROTOCOL = -93, PROTOCOL_UNAVAILABLE = -04, PROTOCOL_NOT_SUPPORTED = -14, PROTOCOL_FAMILY_NOT_SUPPORTED = -24, ADDRESS_FAMILY_NOT_SUPPORTED = -34, SOCKET_NOT_SUPPORTED = -44, CONNECTION_RESET = -54, ALREADY_CONNECTED = -64, NOT_CONNECTED = -74, CONNECTION_REFUSED = -84, NO_HOST = -94, IN_PROGRESS = -05, CANCELLED = -15, MEMORY_ALREADY_MAPPED = -25, // General non-standard errors. CRC_MISMATCH = -100, // General miniaudio-specific errors. FORMAT_NOT_SUPPORTED = -200, DEVICE_TYPE_NOT_SUPPORTED = -201, SHARE_MODE_NOT_SUPPORTED = -202, NO_BACKEND = -203, NO_DEVICE = -204, API_NOT_FOUND = -205, INVALID_DEVICE_CONFIG = -206, LOOP = -207, BACKEND_NOT_ENABLED = -208, // State errors. DEVICE_NOT_INITIALIZED = -300, DEVICE_ALREADY_INITIALIZED = -301, DEVICE_NOT_STARTED = -302, DEVICE_NOT_STOPPED = -303, // Operation errors. FAILED_TO_INIT_BACKEND = -400, FAILED_TO_OPEN_BACKEND_DEVICE = -401, FAILED_TO_START_BACKEND_DEVICE = -402, FAILED_TO_STOP_BACKEND_DEVICE = -403, }
Related Procedures With Parameters
Related Procedures With Returns
- async_notification_event_init
- async_notification_event_signal
- async_notification_event_uninit
- async_notification_event_wait
- async_notification_poll_init
- async_notification_signal
- audio_buffer_alloc_and_init
- audio_buffer_get_available_frames
- audio_buffer_get_cursor_in_pcm_frames
- audio_buffer_get_length_in_pcm_frames
- audio_buffer_init
- audio_buffer_init_copy
- audio_buffer_map
- audio_buffer_ref_get_available_frames
- audio_buffer_ref_get_cursor_in_pcm_frames
- audio_buffer_ref_get_length_in_pcm_frames
- audio_buffer_ref_init
- audio_buffer_ref_map
- audio_buffer_ref_seek_to_pcm_frame
- audio_buffer_ref_set_data
- audio_buffer_ref_unmap
- audio_buffer_seek_to_pcm_frame
- audio_buffer_unmap
- biquad_clear_cache
- biquad_get_heap_size
- biquad_init
- biquad_init_preallocated
- biquad_node_init
- biquad_node_reinit
- biquad_process_pcm_frames
- biquad_reinit
- bpf2_get_heap_size
- bpf2_init
- bpf2_init_preallocated
- bpf2_process_pcm_frames
- bpf2_reinit
- bpf_get_heap_size
- bpf_init
- bpf_init_preallocated
- bpf_node_init
- bpf_node_reinit
- bpf_process_pcm_frames
- bpf_reinit
- channel_converter_get_heap_size
- channel_converter_get_input_channel_map
- channel_converter_get_output_channel_map
- channel_converter_init
- channel_converter_init_preallocated
- channel_converter_process_pcm_frames
- context_enumerate_devices
- context_get_device_info
- context_get_devices
- context_init
- context_uninit
- data_converter_get_expected_output_frame_count
- data_converter_get_heap_size
- data_converter_get_input_channel_map
- data_converter_get_output_channel_map
- data_converter_get_required_input_frame_count
- data_converter_init
- data_converter_init_preallocated
- data_converter_process_pcm_frames
- data_converter_reset
- data_converter_set_rate
- data_converter_set_rate_ratio
- data_source_get_cursor_in_pcm_frames
- data_source_get_cursor_in_seconds
- data_source_get_data_format
- data_source_get_length_in_pcm_frames
- data_source_get_length_in_seconds
- data_source_init
- data_source_node_init
- data_source_node_set_looping
- data_source_read_pcm_frames
- data_source_seek_pcm_frames
- data_source_seek_to_pcm_frame
- data_source_set_current
- data_source_set_loop_point_in_pcm_frames
- data_source_set_looping
- data_source_set_next
- data_source_set_next_callback
- data_source_set_range_in_pcm_frames
- decode_file
- decode_from_vfs
- decode_memory
- decoder_get_available_frames
- decoder_get_cursor_in_pcm_frames
- decoder_get_data_format
- decoder_get_length_in_pcm_frames
- decoder_init
- decoder_init_file
- decoder_init_file_w
- decoder_init_memory
- decoder_init_vfs
- decoder_init_vfs_w
- decoder_read_pcm_frames
- decoder_seek_to_pcm_frame
- decoder_uninit
- default_vfs_init
- delay_init
- delay_node_init
- delay_process_pcm_frames
- device_get_info
- device_get_master_volume
- device_get_master_volume_db
- device_get_name
- device_handle_backend_data_callback
- device_init
- device_init_ex
- device_job_thread_init
- device_job_thread_next
- device_job_thread_post
- device_post_init
- device_set_master_volume
- device_set_master_volume_db
- device_start
- device_stop
- duplex_rb_init
- duplex_rb_uninit
- encoder_init
- encoder_init_file
- encoder_init_file_w
- encoder_init_vfs
- encoder_init_vfs_w
- encoder_write_pcm_frames
- engine_init
- engine_node_get_heap_size
- engine_node_init
- engine_node_init_preallocated
- engine_play_sound
- engine_play_sound_ex
- engine_read_pcm_frames
- engine_set_gain_db
- engine_set_time
- engine_set_time_in_milliseconds
- engine_set_time_in_pcm_frames
- engine_set_volume
- engine_start
- engine_stop
- event_init
- event_signal
- event_wait
- fader_init
- fader_process_pcm_frames
- fence_acquire
- fence_init
- fence_release
- fence_wait
- gainer_get_heap_size
- gainer_get_master_volume
- gainer_init
- gainer_init_preallocated
- gainer_process_pcm_frames
- gainer_set_gain
- gainer_set_gains
- gainer_set_master_volume
- get_backend_from_name
- get_enabled_backends
- hishelf2_get_heap_size
- hishelf2_init
- hishelf2_init_preallocated
- hishelf2_process_pcm_frames
- hishelf2_reinit
- hishelf_node_init
- hishelf_node_reinit
- hpf1_get_heap_size
- hpf1_init
- hpf1_init_preallocated
- hpf1_process_pcm_frames
- hpf1_reinit
- hpf2_get_heap_size
- hpf2_init
- hpf2_init_preallocated
- hpf2_process_pcm_frames
- hpf2_reinit
- hpf_get_heap_size
- hpf_init
- hpf_init_preallocated
- hpf_node_init
- hpf_node_reinit
- hpf_process_pcm_frames
- hpf_reinit
- job_process
- job_queue_get_heap_size
- job_queue_init
- job_queue_init_preallocated
- job_queue_next
- job_queue_post
- linear_resampler_get_expected_output_frame_count
- linear_resampler_get_heap_size
- linear_resampler_get_required_input_frame_count
- linear_resampler_init
- linear_resampler_init_preallocated
- linear_resampler_process_pcm_frames
- linear_resampler_reset
- linear_resampler_set_rate
- linear_resampler_set_rate_ratio
- log_init
- log_post
- log_postf
- log_postv
- log_register_callback
- log_unregister_callback
- loshelf2_get_heap_size
- loshelf2_init
- loshelf2_init_preallocated
- loshelf2_process_pcm_frames
- loshelf2_reinit
- loshelf_node_init
- loshelf_node_reinit
- lpf1_clear_cache
- lpf1_get_heap_size
- lpf1_init
- lpf1_init_preallocated
- lpf1_process_pcm_frames
- lpf1_reinit
- lpf2_clear_cache
- lpf2_get_heap_size
- lpf2_init
- lpf2_init_preallocated
- lpf2_process_pcm_frames
- lpf2_reinit
- lpf_clear_cache
- lpf_get_heap_size
- lpf_init
- lpf_init_preallocated
- lpf_node_init
- lpf_node_reinit
- lpf_process_pcm_frames
- lpf_reinit
- ma_mix_pcm_frames_f32
- mutex_init
- node_attach_output_bus
- node_detach_all_output_buses
- node_detach_output_bus
- node_get_heap_size
- node_graph_init
- node_graph_read_pcm_frames
- node_graph_set_time
- node_init
- node_init_preallocated
- node_set_output_bus_volume
- node_set_state
- node_set_state_time
- node_set_time
- noise_get_heap_size
- noise_init
- noise_init_preallocated
- noise_read_pcm_frames
- noise_set_amplitude
- noise_set_seed
- noise_set_type
- notch2_get_heap_size
- notch2_init
- notch2_init_preallocated
- notch2_process_pcm_frames
- notch2_reinit
- notch_node_init
- notch_node_reinit
- paged_audio_buffer_data_allocate_and_append_page
- paged_audio_buffer_data_allocate_page
- paged_audio_buffer_data_append_page
- paged_audio_buffer_data_free_page
- paged_audio_buffer_data_get_length_in_pcm_frames
- paged_audio_buffer_data_init
- paged_audio_buffer_get_cursor_in_pcm_frames
- paged_audio_buffer_get_length_in_pcm_frames
- paged_audio_buffer_init
- paged_audio_buffer_read_pcm_frames
- paged_audio_buffer_seek_to_pcm_frame
- panner_init
- panner_process_pcm_frames
- pcm_rb_acquire_read
- pcm_rb_acquire_write
- pcm_rb_commit_read
- pcm_rb_commit_write
- pcm_rb_init
- pcm_rb_init_ex
- pcm_rb_seek_read
- pcm_rb_seek_write
- peak2_get_heap_size
- peak2_init
- peak2_init_preallocated
- peak2_process_pcm_frames
- peak2_reinit
- peak_node_init
- peak_node_reinit
- pulsewave_init
- pulsewave_read_pcm_frames
- pulsewave_seek_to_pcm_frame
- pulsewave_set_amplitude
- pulsewave_set_duty_cycle
- pulsewave_set_frequency
- pulsewave_set_sample_rate
- rb_acquire_read
- rb_acquire_write
- rb_commit_read
- rb_commit_write
- rb_init
- rb_init_ex
- rb_seek_read
- rb_seek_write
- resampler_get_expected_output_frame_count
- resampler_get_heap_size
- resampler_get_required_input_frame_count
- resampler_init
- resampler_init_preallocated
- resampler_process_pcm_frames
- resampler_reset
- resampler_set_rate
- resampler_set_rate_ratio
- resource_manager_data_buffer_get_available_frames
- resource_manager_data_buffer_get_cursor_in_pcm_frames
- resource_manager_data_buffer_get_data_format
- resource_manager_data_buffer_get_length_in_pcm_frames
- resource_manager_data_buffer_init
- resource_manager_data_buffer_init_copy
- resource_manager_data_buffer_init_ex
- resource_manager_data_buffer_init_w
- resource_manager_data_buffer_read_pcm_frames
- resource_manager_data_buffer_result
- resource_manager_data_buffer_seek_to_pcm_frame
- resource_manager_data_buffer_set_looping
- resource_manager_data_buffer_uninit
- resource_manager_data_source_get_available_frames
- resource_manager_data_source_get_cursor_in_pcm_frames
- resource_manager_data_source_get_data_format
- resource_manager_data_source_get_length_in_pcm_frames
- resource_manager_data_source_init
- resource_manager_data_source_init_copy
- resource_manager_data_source_init_ex
- resource_manager_data_source_init_w
- resource_manager_data_source_read_pcm_frames
- resource_manager_data_source_result
- resource_manager_data_source_seek_to_pcm_frame
- resource_manager_data_source_set_looping
- resource_manager_data_source_uninit
- resource_manager_data_stream_get_available_frames
- resource_manager_data_stream_get_cursor_in_pcm_frames
- resource_manager_data_stream_get_data_format
- resource_manager_data_stream_get_length_in_pcm_frames
- resource_manager_data_stream_init
- resource_manager_data_stream_init_ex
- resource_manager_data_stream_init_w
- resource_manager_data_stream_read_pcm_frames
- resource_manager_data_stream_result
- resource_manager_data_stream_seek_to_pcm_frame
- resource_manager_data_stream_set_looping
- resource_manager_data_stream_uninit
- resource_manager_init
- resource_manager_next_job
- resource_manager_post_job
- resource_manager_post_job_quit
- resource_manager_process_job
- resource_manager_process_next_job
- resource_manager_register_decoded_data
- resource_manager_register_decoded_data_w
- resource_manager_register_encoded_data
- resource_manager_register_encoded_data_w
- resource_manager_register_file
- resource_manager_register_file_w
- resource_manager_unregister_data
- resource_manager_unregister_data_w
- resource_manager_unregister_file
- resource_manager_unregister_file_w
- slot_allocator_alloc
- slot_allocator_free
- slot_allocator_get_heap_size
- slot_allocator_init
- slot_allocator_init_preallocated
- sound_get_cursor_in_pcm_frames
- sound_get_cursor_in_seconds
- sound_get_data_format
- sound_get_length_in_pcm_frames
- sound_get_length_in_seconds
- sound_group_init
- sound_group_init_ex
- sound_group_start
- sound_group_stop
- sound_init_copy
- sound_init_ex
- sound_init_from_data_source
- sound_init_from_file
- sound_init_from_file_w
- sound_seek_to_pcm_frame
- sound_start
- sound_stop
- spatializer_get_heap_size
- spatializer_get_master_volume
- spatializer_init
- spatializer_init_preallocated
- spatializer_listener_get_heap_size
- spatializer_listener_init
- spatializer_listener_init_preallocated
- spatializer_process_pcm_frames
- spatializer_set_master_volume
- spinlock_lock
- spinlock_lock_noyield
- spinlock_unlock
- splitter_node_init
- vfs_close
- vfs_info
- vfs_open
- vfs_open_and_read_file
- vfs_open_w
- vfs_read
- vfs_seek
- vfs_tell
- vfs_write
- waveform_init
- waveform_read_pcm_frames
- waveform_seek_to_pcm_frame
- waveform_set_amplitude
- waveform_set_frequency
- waveform_set_sample_rate
- waveform_set_type
seek_origin ¶
seek_origin :: enum i32 { start, current, end, // Not used by decoders. }
Related Procedures With Parameters
semaphore ¶
semaphore :: distinct rawptr
share_mode ¶
share_mode :: enum i32 { shared = 0, exclusive, }
slot_allocator ¶
slot_allocator :: struct { pGroups: [^]slot_allocator_group, // Slots are grouped in chunks of 32. pSlots: [^]u32, // 32 bits for reference counting for ABA mitigation. count: u32, // Allocation count. capacity: u32, // Memory management. _ownsHeap: b32, _pHeap: rawptr, }
Related Procedures With Parameters
slot_allocator_config ¶
slot_allocator_config :: struct { capacity: u32, }
Slot Allocator -------------- The idea of the slot allocator is for it to be used in conjunction with a fixed sized buffer. You use the slot allocator to allocator an index that can be used as the insertion point for an object.
Slots are reference counted to help mitigate the ABA problem in the lock-free queue we use for tracking jobs.
The slot index is stored in the low 32 bits. The reference counter is stored in the high 32 bits:
+-----------------+-----------------+ | 32 Bits | 32 Bits | +-----------------+-----------------+ | Reference Count | Slot Index | +-----------------+-----------------+
Related Procedures With Parameters
Related Procedures With Returns
slot_allocator_group ¶
slot_allocator_group :: struct { bitfield: u32, }
sound ¶
sound :: struct { engineNode: engine_node, // Must be the first member for compatibility with the ma_node API. pDataSource: ^data_source, seekTarget: u64, // atomic // The PCM frame index to seek to in the mixing thread. Set to (~(ma_uint64)0) to not perform any seeking. atEnd: b32, // atomic endCallback: sound_end_proc, pEndCallbackUserData: rawptr, ownsDataSource: b8, // We're declaring a resource manager data source object here to save us a malloc when loading a // sound via the resource manager, which I *think* will be the most common scenario. pResourceManagerDataSource: ^resource_manager_data_source, }
Related Procedures With Parameters
- sound_at_end
- sound_get_attenuation_model
- sound_get_cone
- sound_get_current_fade_volume
- sound_get_cursor_in_pcm_frames
- sound_get_cursor_in_seconds
- sound_get_data_format
- sound_get_data_source
- sound_get_direction
- sound_get_direction_to_listener
- sound_get_directional_attenuation_factor
- sound_get_doppler_factor
- sound_get_engine
- sound_get_length_in_pcm_frames
- sound_get_length_in_seconds
- sound_get_listener_index
- sound_get_max_distance
- sound_get_max_gain
- sound_get_min_distance
- sound_get_min_gain
- sound_get_pan
- sound_get_pan_mode
- sound_get_pinned_listener_index
- sound_get_pitch
- sound_get_position
- sound_get_positioning
- sound_get_rolloff
- sound_get_time_in_milliseconds
- sound_get_time_in_pcm_frames
- sound_get_velocity
- sound_get_volume
- sound_init_copy
- sound_init_ex
- sound_init_from_data_source
- sound_init_from_file
- sound_init_from_file_w
- sound_is_looping
- sound_is_playing
- sound_is_spatialization_enabled
- sound_seek_to_pcm_frame
- sound_set_attenuation_model
- sound_set_cone
- sound_set_direction
- sound_set_directional_attenuation_factor
- sound_set_doppler_factor
- sound_set_end_callback
- sound_set_fade_in_milliseconds
- sound_set_fade_in_pcm_frames
- sound_set_fade_start_in_milliseconds
- sound_set_fade_start_in_pcm_frames
- sound_set_looping
- sound_set_max_distance
- sound_set_max_gain
- sound_set_min_distance
- sound_set_min_gain
- sound_set_pan
- sound_set_pan_mode
- sound_set_pinned_listener_index
- sound_set_pitch
- sound_set_position
- sound_set_positioning
- sound_set_rolloff
- sound_set_spatialization_enabled
- sound_set_start_time_in_milliseconds
- sound_set_start_time_in_pcm_frames
- sound_set_stop_time_in_milliseconds
- sound_set_stop_time_in_pcm_frames
- sound_set_stop_time_with_fade_in_milliseconds
- sound_set_stop_time_with_fade_in_pcm_frames
- sound_set_velocity
- sound_set_volume
- sound_start
- sound_stop
- sound_stop_with_fade_in_milliseconds
- sound_stop_with_fade_in_pcm_frames
- sound_uninit
sound_config ¶
sound_config :: struct { pFilePath: cstring, // Set this to load from the resource manager. pFilePathW: [^]u16, // Set this to load from the resource manager. pDataSource: ^data_source, // Set this to load from an existing data source. pInitialAttachment: ^node, // If set, the sound will be attached to an input of this node. This can be set to a ma_sound. If set to NULL, the sound will be attached directly to the endpoint unless MA_SOUND_FLAG_NO_DEFAULT_ATTACHMENT is set in `flags`. initialAttachmentInputBusIndex: u32, // The index of the input bus of pInitialAttachment to attach the sound to. channelsIn: u32, // Ignored if using a data source as input (the data source's channel count will be used always). Otherwise, setting to 0 will cause the engine's channel count to be used. channelsOut: u32, // Set this to 0 (default) to use the engine's channel count. Set to MA_SOUND_SOURCE_CHANNEL_COUNT to use the data source's channel count (only used if using a data source as input). monoExpansionMode: mono_expansion_mode, // Controls how the mono channel should be expanded to other channels when spatialization is disabled on a sound. flags: u32, // A combination of MA_SOUND_FLAG_* flags. volumeSmoothTimeInPCMFrames: u32, // The number of frames to smooth over volume changes. Defaults to 0 in which case no smoothing is used. initialSeekPointInPCMFrames: u64, // Initializes the sound such that it's seeked to this location by default. rangeBegInPCMFrames: u64, rangeEndInPCMFrames: u64, loopPointBegInPCMFrames: u64, loopPointEndInPCMFrames: u64, isLooping: b32, endCallback: sound_end_proc, // Fired when the sound reaches the end. Will be fired from the audio thread. Do not restart, uninitialize or otherwise change the state of the sound from here. Instead fire an event or set a variable to indicate to a different thread to change the start of the sound. Will not be fired in response to a scheduled stop with ma_sound_set_stop_time_*(). pEndCallbackUserData: rawptr, initNotifications: resource_manager_pipeline_notifications, pDoneFence: ^fence, }
Related Procedures With Parameters
Related Procedures With Returns
sound_flags ¶
sound_flags :: enum i32 { // Resource manager flags. STREAM = 1, // MA_RESOURCE_MANAGER_DATA_SOURCE_FLAG_STREAM DECODE = 2, // MA_RESOURCE_MANAGER_DATA_SOURCE_FLAG_DECODE ASYNC = 4, // MA_RESOURCE_MANAGER_DATA_SOURCE_FLAG_ASYNC WAIT_INIT = 8, // MA_RESOURCE_MANAGER_DATA_SOURCE_FLAG_WAIT_INIT UNKNOWN_LENGTH = 16, // MA_RESOURCE_MANAGER_DATA_SOURCE_FLAG_UNKNOWN_LENGTH // ma_sound specific flags. NO_DEFAULT_ATTACHMENT = 4096, // Do not attach to the endpoint by default. Useful for when setting up nodes in a complex graph system. NO_PITCH = 8192, // Disable pitch shifting with ma_sound_set_pitch() and ma_sound_group_set_pitch(). This is an optimization. NO_SPATIALIZATION = 16384, // Disable spatialization. }
Sound flags.
sound_group ¶
sound_group :: struct { engineNode: engine_node, // Must be the first member for compatibility with the ma_node API. pDataSource: ^data_source, seekTarget: u64, // atomic // The PCM frame index to seek to in the mixing thread. Set to (~(ma_uint64)0) to not perform any seeking. atEnd: b32, // atomic endCallback: sound_end_proc, pEndCallbackUserData: rawptr, ownsDataSource: b8, // We're declaring a resource manager data source object here to save us a malloc when loading a // sound via the resource manager, which I *think* will be the most common scenario. pResourceManagerDataSource: ^resource_manager_data_source, }
Related Procedures With Parameters
- engine_play_sound
- sound_group_get_attenuation_model
- sound_group_get_cone
- sound_group_get_current_fade_volume
- sound_group_get_direction
- sound_group_get_direction_to_listener
- sound_group_get_directional_attenuation_factor
- sound_group_get_doppler_factor
- sound_group_get_engine
- sound_group_get_listener_index
- sound_group_get_max_distance
- sound_group_get_max_gain
- sound_group_get_min_distance
- sound_group_get_min_gain
- sound_group_get_pan
- sound_group_get_pan_mode
- sound_group_get_pinned_listener_index
- sound_group_get_pitch
- sound_group_get_position
- sound_group_get_positioning
- sound_group_get_rolloff
- sound_group_get_time_in_pcm_frames
- sound_group_get_velocity
- sound_group_get_volume
- sound_group_init
- sound_group_init_ex
- sound_group_is_playing
- sound_group_is_spatialization_enabled
- sound_group_set_attenuation_model
- sound_group_set_cone
- sound_group_set_direction
- sound_group_set_directional_attenuation_factor
- sound_group_set_doppler_factor
- sound_group_set_fade_in_milliseconds
- sound_group_set_fade_in_pcm_frames
- sound_group_set_max_distance
- sound_group_set_max_gain
- sound_group_set_min_distance
- sound_group_set_min_gain
- sound_group_set_pan
- sound_group_set_pan_mode
- sound_group_set_pinned_listener_index
- sound_group_set_pitch
- sound_group_set_position
- sound_group_set_positioning
- sound_group_set_rolloff
- sound_group_set_spatialization_enabled
- sound_group_set_start_time_in_milliseconds
- sound_group_set_start_time_in_pcm_frames
- sound_group_set_stop_time_in_milliseconds
- sound_group_set_stop_time_in_pcm_frames
- sound_group_set_velocity
- sound_group_set_volume
- sound_group_start
- sound_group_stop
- sound_group_uninit
- sound_init_copy
- sound_init_from_data_source
- sound_init_from_file
- sound_init_from_file_w
sound_group_config ¶
sound_group_config :: struct { pFilePath: cstring, // Set this to load from the resource manager. pFilePathW: [^]u16, // Set this to load from the resource manager. pDataSource: ^data_source, // Set this to load from an existing data source. pInitialAttachment: ^node, // If set, the sound will be attached to an input of this node. This can be set to a ma_sound. If set to NULL, the sound will be attached directly to the endpoint unless MA_SOUND_FLAG_NO_DEFAULT_ATTACHMENT is set in `flags`. initialAttachmentInputBusIndex: u32, // The index of the input bus of pInitialAttachment to attach the sound to. channelsIn: u32, // Ignored if using a data source as input (the data source's channel count will be used always). Otherwise, setting to 0 will cause the engine's channel count to be used. channelsOut: u32, // Set this to 0 (default) to use the engine's channel count. Set to MA_SOUND_SOURCE_CHANNEL_COUNT to use the data source's channel count (only used if using a data source as input). monoExpansionMode: mono_expansion_mode, // Controls how the mono channel should be expanded to other channels when spatialization is disabled on a sound. flags: u32, // A combination of MA_SOUND_FLAG_* flags. volumeSmoothTimeInPCMFrames: u32, // The number of frames to smooth over volume changes. Defaults to 0 in which case no smoothing is used. initialSeekPointInPCMFrames: u64, // Initializes the sound such that it's seeked to this location by default. rangeBegInPCMFrames: u64, rangeEndInPCMFrames: u64, loopPointBegInPCMFrames: u64, loopPointEndInPCMFrames: u64, isLooping: b32, endCallback: sound_end_proc, // Fired when the sound reaches the end. Will be fired from the audio thread. Do not restart, uninitialize or otherwise change the state of the sound from here. Instead fire an event or set a variable to indicate to a different thread to change the start of the sound. Will not be fired in response to a scheduled stop with ma_sound_set_stop_time_*(). pEndCallbackUserData: rawptr, initNotifications: resource_manager_pipeline_notifications, pDoneFence: ^fence, }
A sound group is just a sound.
Related Procedures With Parameters
Related Procedures With Returns
sound_inlined ¶
sound_inlined :: struct { sound: sound, pNext: ^sound_inlined, pPrev: ^sound_inlined, }
Structure specifically for sounds played with ma_engine_play_sound(). Making this a separate structure to reduce overhead.
spatializer ¶
spatializer :: struct { channelsIn: u32, channelsOut: u32, pChannelMapIn: [^]channel, attenuationModel: attenuation_model, positioning: positioning, handedness: handedness, // Defaults to right. Forward is -1 on the Z axis. In a left handed system, forward is +1 on the Z axis. minGain: f32, maxGain: f32, minDistance: f32, maxDistance: f32, rolloff: f32, coneInnerAngleInRadians: f32, coneOuterAngleInRadians: f32, coneOuterGain: f32, dopplerFactor: f32, // Set to 0 to disable doppler effect. directionalAttenuationFactor: f32, // Set to 0 to disable directional attenuation. gainSmoothTimeInFrames: u32, // When the gain of a channel changes during spatialization, the transition will be linearly interpolated over this number of frames. position: atomic_vec3f, direction: atomic_vec3f, velocity: atomic_vec3f, // For doppler effect. dopplerPitch: f32, // Will be updated by ma_spatializer_process_pcm_frames() and can be used by higher level functions to apply a pitch shift for doppler effect. minSpatializationChannelGain: f32, gainer: gainer, // For smooth gain transitions. pNewChannelGainsOut: [^]f32, // Memory management. _pHeap: rawptr, _ownsHeap: b32, }
Related Procedures With Parameters
- spatializer_get_attenuation_model
- spatializer_get_cone
- spatializer_get_direction
- spatializer_get_directional_attenuation_factor
- spatializer_get_doppler_factor
- spatializer_get_input_channels
- spatializer_get_master_volume
- spatializer_get_max_distance
- spatializer_get_max_gain
- spatializer_get_min_distance
- spatializer_get_min_gain
- spatializer_get_output_channels
- spatializer_get_position
- spatializer_get_positioning
- spatializer_get_relative_position_and_direction
- spatializer_get_rolloff
- spatializer_get_velocity
- spatializer_init
- spatializer_init_preallocated
- spatializer_process_pcm_frames
- spatializer_set_attenuation_model
- spatializer_set_cone
- spatializer_set_direction
- spatializer_set_directional_attenuation_factor
- spatializer_set_doppler_factor
- spatializer_set_master_volume
- spatializer_set_max_distance
- spatializer_set_max_gain
- spatializer_set_min_distance
- spatializer_set_min_gain
- spatializer_set_position
- spatializer_set_positioning
- spatializer_set_rolloff
- spatializer_set_velocity
- spatializer_uninit
spatializer_config ¶
spatializer_config :: struct { channelsIn: u32, channelsOut: u32, pChannelMapIn: [^]channel, attenuationModel: attenuation_model, positioning: positioning, handedness: handedness, // Defaults to right. Forward is -1 on the Z axis. In a left handed system, forward is +1 on the Z axis. minGain: f32, maxGain: f32, minDistance: f32, maxDistance: f32, rolloff: f32, coneInnerAngleInRadians: f32, coneOuterAngleInRadians: f32, coneOuterGain: f32, dopplerFactor: f32, // Set to 0 to disable doppler effect. directionalAttenuationFactor: f32, // Set to 0 to disable directional attenuation. minSpatializationChannelGain: f32, // The minimal scaling factor to apply to channel gains when accounting for the direction of the sound relative to the listener. Must be in the range of 0..1. Smaller values means more aggressive directional panning, larger values means more subtle directional panning. gainSmoothTimeInFrames: u32, }
Related Procedures With Parameters
Related Procedures With Returns
spatializer_listener ¶
spatializer_listener :: struct { config: spatializer_listener_config, position: atomic_vec3f, // The absolute position of the listener. direction: atomic_vec3f, // The direction the listener is facing. The world up vector is config.worldUp. velocity: atomic_vec3f, isEnabled: b32, // Memory management. _ownsHeap: b32, _pHeap: rawptr, }
Related Procedures With Parameters
- spatializer_get_relative_position_and_direction
- spatializer_listener_get_channel_map
- spatializer_listener_get_cone
- spatializer_listener_get_direction
- spatializer_listener_get_position
- spatializer_listener_get_speed_of_sound
- spatializer_listener_get_velocity
- spatializer_listener_get_world_up
- spatializer_listener_init
- spatializer_listener_init_preallocated
- spatializer_listener_is_enabled
- spatializer_listener_set_cone
- spatializer_listener_set_direction
- spatializer_listener_set_enabled
- spatializer_listener_set_position
- spatializer_listener_set_speed_of_sound
- spatializer_listener_set_velocity
- spatializer_listener_set_world_up
- spatializer_listener_uninit
- spatializer_process_pcm_frames
spatializer_listener_config ¶
spatializer_listener_config :: struct { channelsOut: u32, pChannelMapOut: [^]channel, handedness: handedness, // Defaults to right. Forward is -1 on the Z axis. In a left handed system, forward is +1 on the Z axis. coneInnerAngleInRadians: f32, coneOuterAngleInRadians: f32, coneOuterGain: f32, speedOfSound: f32, worldUp: vec3f, }
Related Procedures With Parameters
Related Procedures With Returns
spinlock ¶
spinlock :: distinct u32
Spinlocks are 32-bit for compatibility reasons.
Related Procedures With Parameters
splitter_node_config ¶
splitter_node_config :: struct { nodeConfig: node_config, channels: u32, outputBusCount: u32, }
Splitter Node. 1 input, many outputs. Used for splitting/copying a stream so it can be as input into two separate output nodes.
Related Procedures With Parameters
Related Procedures With Returns
standard_channel_map ¶
standard_channel_map :: enum i32 { microsoft, alsa, rfc3551, // Based off AIFF. flac, vorbis, sound4, // FreeBSD's sound(4). sndio, // www.sndio.org/tips.html webaudio = 3, // https://webaudio.github.io/web-audio-api/#ChannelOrdering. Only 1, 2, 4 and 6 channels are defined, but can fill in the gaps with logical assumptions. default = 0, }
Related Procedures With Parameters
standard_sample_rate ¶
standard_sample_rate :: enum u32 { // Standard rates need to be in priority order. rate_48000 = 48000, // Most common rate_44100 = 44100, rate_32000 = 32000, // Lows rate_24000 = 24000, rate_22050 = 22050, rate_88200 = 88200, // Highs rate_96000 = 96000, rate_176400 = 176400, rate_192000 = 192000, rate_16000 = 16000, // Extreme lows rate_11025 = 11025, rate_8000 = 8000, rate_352800 = 352800, // Extreme highs rate_384000 = 384000, rate_min = 8000, rate_max = 384000, rate_count = 14, // Need to maintain the count manually. Make sure this is updated if items are added to enum. }
stop_proc ¶
stop_proc :: proc "c" (pDevice: ^device)
DEPRECATED. Use ma_device_notification_proc instead.
The callback for when the device has been stopped.
This will be called when the device is stopped explicitly with ma_device_stop()
and also called implicitly when the device is stopped through external forces
such as being unplugged or an internal error occurring.
Parameters ---------- pDevice (in) A pointer to the device that has just stopped.
Remarks ------- Do not restart or uninitialize the device from the callback.
stream_format ¶
stream_format :: enum i32 { pcm = 0, }
stream_layout ¶
stream_layout :: enum i32 { interleaved = 0, deinterleaved, }
thread_priority ¶
thread_priority :: enum i32 { idle = -5, lowest = -4, low = -3, normal = -2, high = -1, highest = 0, realtime = 1, default = 0, }
Thread priorities should be ordered such that the default priority of the worker thread is 0.
vec3f ¶
Spatializer.
Related Procedures With Parameters
Related Procedures With Returns
- engine_listener_get_direction
- engine_listener_get_position
- engine_listener_get_velocity
- engine_listener_get_world_up
- sound_get_direction
- sound_get_direction_to_listener
- sound_get_position
- sound_get_velocity
- sound_group_get_direction
- sound_group_get_direction_to_listener
- sound_group_get_position
- sound_group_get_velocity
- spatializer_get_direction
- spatializer_get_position
- spatializer_get_velocity
- spatializer_listener_get_direction
- spatializer_listener_get_position
- spatializer_listener_get_velocity
- spatializer_listener_get_world_up
vfs ¶
vfs :: struct {}
*******************************
VFS ===
The VFS object (virtual file system) is what's used to customize file access. This is useful in cases where stdio FILE* based APIs may not be entirely appropriate for a given situation.
*******************************
Related Procedures With Parameters
vfs_callbacks ¶
vfs_callbacks :: struct { onOpen: proc "c" (pVFS: ^vfs, pFilePath: cstring, openMode: u32, pFile: ^vfs_file) -> result, onOpenW: proc "c" (pVFS: ^vfs, pFilePath: [^]u16, openMode: u32, pFile: ^vfs_file) -> result, onClose: proc "c" (pVFS: ^vfs, file: vfs_file) -> result, onRead: proc "c" (pVFS: ^vfs, file: vfs_file, pDst: rawptr, sizeInBytes: uint, pBytesRead: ^uint) -> result, onWrite: proc "c" (pVFS: ^vfs, file: vfs_file, pSrc: rawptr, sizeInBytes: uint, pBytesWritten: ^uint) -> result, onSeek: proc "c" (pVFS: ^vfs, file: vfs_file, offset: i64, origin: seek_origin) -> result, onTell: proc "c" (pVFS: ^vfs, file: vfs_file, pCursor: ^i64) -> result, onInfo: proc "c" (pVFS: ^vfs, file: vfs_file, pInfo: ^file_info) -> result, }
wasapi_usage ¶
wasapi_usage :: enum i32 { default = 0, games, pro_audio, }
WASAPI audio thread priority characteristics.
waveform ¶
waveform :: struct { ds: data_source_base, config: waveform_config, advance: f64, time: f64, }
Related Procedures With Parameters
waveform_config ¶
waveform_config :: struct { format: format, channels: u32, sampleRate: u32, type: waveform_type, amplitude: f64, frequency: f64, }
Related Procedures With Parameters
Related Procedures With Returns
waveform_type ¶
waveform_type :: enum i32 { sine, square, triangle, sawtooth, }
Related Procedures With Parameters
Constants
BACKEND_COUNT ¶
BACKEND_COUNT :: len(backend)
BINDINGS_VERSION ¶
BINDINGS_VERSION: [3]u32 : [3]u32{BINDINGS_VERSION_MAJOR, BINDINGS_VERSION_MINOR, BINDINGS_VERSION_REVISION}
BINDINGS_VERSION_MAJOR ¶
BINDINGS_VERSION_MAJOR :: 0
BINDINGS_VERSION_MINOR ¶
BINDINGS_VERSION_MINOR :: 11
BINDINGS_VERSION_REVISION ¶
BINDINGS_VERSION_REVISION :: 21
BINDINGS_VERSION_STRING ¶
BINDINGS_VERSION_STRING :: "0.11.21"
CHANNEL_INDEX_NULL ¶
CHANNEL_INDEX_NULL :: 255
*******************************
Channel Maps
*******************************
This is used in the shuffle table to indicate that the channel index is undefined and should be ignored.
DATA_FORMAT_FLAG_EXCLUSIVE_MODE ¶
DATA_FORMAT_FLAG_EXCLUSIVE_MODE :: 1 << 1
If set, this is supported in exclusive mode. Otherwise not natively supported by exclusive mode.
DATA_SOURCE_SELF_MANAGED_RANGE_AND_LOOP_POINT ¶
DATA_SOURCE_SELF_MANAGED_RANGE_AND_LOOP_POINT :: 0x00000001
ENGINE_MAX_LISTENERS ¶
ENGINE_MAX_LISTENERS :: 4
JOB_TYPE_RESOURCE_MANAGER_QUEUE_FLAG_NON_BLOCKING ¶
JOB_TYPE_RESOURCE_MANAGER_QUEUE_FLAG_NON_BLOCKING :: job_queue_flags.NON_BLOCKING
LISTENER_INDEX_CLOSEST ¶
LISTENER_INDEX_CLOSEST :: 255
MAX_CHANNELS ¶
MAX_CHANNELS :: 254
MAX_DEVICE_NAME_LENGTH ¶
MAX_DEVICE_NAME_LENGTH :: 255
MAX_FILTER_ORDER ¶
MAX_FILTER_ORDER :: 8
MAX_LOG_CALLBACKS ¶
MAX_LOG_CALLBACKS :: 4
MAX_NODE_LOCAL_BUS_COUNT ¶
MAX_NODE_LOCAL_BUS_COUNT :: 2
Used internally by miniaudio for memory management. Must never exceed MA_MAX_NODE_BUS_COUNT.
MINIAUDIO_SHARED ¶
MINIAUDIO_SHARED :: #config(MINIAUDIO_SHARED, false)
MIN_CHANNELS ¶
MIN_CHANNELS :: 1
NODE_BUS_COUNT_UNKNOWN ¶
NODE_BUS_COUNT_UNKNOWN :: 255
Use this when the bus count is determined by the node instance rather than the vtable.
NO_THREADING ¶
NO_THREADING :: false
RESOURCE_MANAGER_MAX_JOB_THREAD_COUNT ¶
RESOURCE_MANAGER_MAX_JOB_THREAD_COUNT :: 64
Maximum job thread count will be restricted to this, but this may be removed later and replaced with a heap allocation thereby removing any limitation.
SIMD_ALIGNMENT ¶
SIMD_ALIGNMENT :: 32
SIMD alignment in bytes. Currently set to 32 bytes in preparation for future AVX optimizations.
SOUND_SOURCE_CHANNEL_COUNT ¶
SOUND_SOURCE_CHANNEL_COUNT :: 0xFFFFFFFF
SUPPORT_ALSA ¶
SUPPORT_ALSA :: ODIN_OS == .Linux
SUPPORT_COREAUDIO ¶
SUPPORT_COREAUDIO :: ODIN_OS == .Darwin
SUPPORT_CUSTOM ¶
SUPPORT_CUSTOM :: true
SUPPORT_DSOUND ¶
SUPPORT_DSOUND :: ODIN_OS == .Windows
SUPPORT_JACK ¶
SUPPORT_JACK :: ODIN_OS == .Windows
SUPPORT_OSS ¶
SUPPORT_OSS :: ODIN_OS == .FreeBSD
SUPPORT_PULSEAUDIO ¶
SUPPORT_PULSEAUDIO :: ODIN_OS == .Linux
SUPPORT_SNDIO ¶
SUPPORT_SNDIO :: ODIN_OS == .OpenBSD
SUPPORT_WASAPI ¶
SUPPORT_WASAPI :: ODIN_OS == .Windows
SUPPORT_WINMM ¶
SUPPORT_WINMM :: ODIN_OS == .Windows
USE_EXPERIMENTAL_LOCK_FREE_JOB_QUEUE ¶
USE_EXPERIMENTAL_LOCK_FREE_JOB_QUEUE :: false
Variables
This section is empty.
Procedures
aligned_free ¶
aligned_free :: proc "c" (p: rawptr, pAllocationCallbacks: ^allocation_callbacks) ---
Free's an aligned malloc'd buffer.
aligned_malloc ¶
aligned_malloc :: proc "c" (sz, alignment: uint, pAllocationCallbacks: ^allocation_callbacks) -> rawptr ---
Performs an aligned malloc, with the assumption that the alignment is a power of 2.
async_notification_event_init ¶
async_notification_event_init :: proc "c" (pNotificationEvent: ^async_notification_event) -> result ---
async_notification_event_signal ¶
async_notification_event_signal :: proc "c" (pNotificationEvent: ^async_notification_event) -> result ---
async_notification_event_uninit ¶
async_notification_event_uninit :: proc "c" (pNotificationEvent: ^async_notification_event) -> result ---
async_notification_event_wait ¶
async_notification_event_wait :: proc "c" (pNotificationEvent: ^async_notification_event) -> result ---
async_notification_poll_init ¶
async_notification_poll_init :: proc "c" (pNotificationPoll: ^async_notification_poll) -> result ---
async_notification_poll_is_signalled ¶
async_notification_poll_is_signalled :: proc "c" (pNotificationPoll: ^async_notification_poll) -> b32 ---
async_notification_signal ¶
async_notification_signal :: proc "c" (pNotification: ^async_notification) -> result ---
audio_buffer_alloc_and_init ¶
audio_buffer_alloc_and_init :: proc "c" (pConfig: ^audio_buffer_config, ppAudioBuffer: ^^audio_buffer) -> result ---
Always copies the data. Doesn't make sense to use this otherwise. Use ma_audio_buffer_uninit_and_free() to uninit.
audio_buffer_at_end ¶
audio_buffer_at_end :: proc "c" (pAudioBuffer: ^audio_buffer) -> b32 ---
audio_buffer_config_init ¶
audio_buffer_config_init :: proc "c" (format: format, channels: u32, sizeInFrames: u64, pData: rawptr, pAllocationCallbacks: ^allocation_callbacks) -> audio_buffer_config ---
audio_buffer_get_available_frames ¶
audio_buffer_get_available_frames :: proc "c" (pAudioBuffer: ^audio_buffer, pAvailableFrames: ^u64) -> result ---
audio_buffer_get_cursor_in_pcm_frames ¶
audio_buffer_get_cursor_in_pcm_frames :: proc "c" (pAudioBuffer: ^audio_buffer, pCursor: ^u64) -> result ---
audio_buffer_get_length_in_pcm_frames ¶
audio_buffer_get_length_in_pcm_frames :: proc "c" (pAudioBuffer: ^audio_buffer, pLength: ^u64) -> result ---
audio_buffer_init ¶
audio_buffer_init :: proc "c" (pConfig: ^audio_buffer_config, pAudioBuffer: ^audio_buffer) -> result ---
audio_buffer_init_copy ¶
audio_buffer_init_copy :: proc "c" (pConfig: ^audio_buffer_config, pAudioBuffer: ^audio_buffer) -> result ---
audio_buffer_map ¶
audio_buffer_map :: proc "c" (pAudioBuffer: ^audio_buffer, ppFramesOut: ^rawptr, pFrameCount: ^u64) -> result ---
audio_buffer_read_pcm_frames ¶
audio_buffer_read_pcm_frames :: proc "c" (pAudioBuffer: ^audio_buffer, pFramesOut: rawptr, frameCount: u64, loop: b32) -> u64 ---
audio_buffer_ref_at_end ¶
audio_buffer_ref_at_end :: proc "c" (pAudioBufferRef: ^audio_buffer_ref) -> b32 ---
audio_buffer_ref_get_available_frames ¶
audio_buffer_ref_get_available_frames :: proc "c" (pAudioBufferRef: ^audio_buffer_ref, pAvailableFrames: ^u64) -> result ---
audio_buffer_ref_get_cursor_in_pcm_frames ¶
audio_buffer_ref_get_cursor_in_pcm_frames :: proc "c" (pAudioBufferRef: ^audio_buffer_ref, pCursor: ^u64) -> result ---
audio_buffer_ref_get_length_in_pcm_frames ¶
audio_buffer_ref_get_length_in_pcm_frames :: proc "c" (pAudioBufferRef: ^audio_buffer_ref, pLength: ^u64) -> result ---
audio_buffer_ref_map ¶
audio_buffer_ref_map :: proc "c" (pAudioBufferRef: ^audio_buffer_ref, ppFramesOut: ^rawptr, pFrameCount: ^u64) -> result ---
audio_buffer_ref_read_pcm_frames ¶
audio_buffer_ref_read_pcm_frames :: proc "c" (pAudioBufferRef: ^audio_buffer_ref, pFramesOut: rawptr, frameCount: u64, loop: b32) -> u64 ---
audio_buffer_ref_seek_to_pcm_frame ¶
audio_buffer_ref_seek_to_pcm_frame :: proc "c" (pAudioBufferRef: ^audio_buffer_ref, frameIndex: u64) -> result ---
audio_buffer_ref_set_data ¶
audio_buffer_ref_set_data :: proc "c" (pAudioBufferRef: ^audio_buffer_ref, pData: rawptr, sizeInFrames: u64) -> result ---
audio_buffer_ref_uninit ¶
audio_buffer_ref_uninit :: proc "c" (pAudioBufferRef: ^audio_buffer_ref) ---
audio_buffer_ref_unmap ¶
audio_buffer_ref_unmap :: proc "c" (pAudioBufferRef: ^audio_buffer_ref, frameCount: u64) -> result ---
Returns MA_AT_END if the end has been reached. This should be considered successful.
audio_buffer_seek_to_pcm_frame ¶
audio_buffer_seek_to_pcm_frame :: proc "c" (pAudioBuffer: ^audio_buffer, frameIndex: u64) -> result ---
audio_buffer_uninit ¶
audio_buffer_uninit :: proc "c" (pAudioBuffer: ^audio_buffer) ---
audio_buffer_uninit_and_free ¶
audio_buffer_uninit_and_free :: proc "c" (pAudioBuffer: ^audio_buffer) ---
audio_buffer_unmap ¶
audio_buffer_unmap :: proc "c" (pAudioBuffer: ^audio_buffer, frameCount: u64) -> result ---
Returns MA_AT_END if the end has been reached. This should be considered successful.
biquad_config_init ¶
biquad_config_init :: proc "c" ( format: format, channels: u32, b0, b1, b2, a0, a1, a2: f64, ) -> biquad_config ---
biquad_get_heap_size ¶
biquad_get_heap_size :: proc "c" (pConfig: ^biquad_config, pHeapSizeInBytes: ^uint) -> result ---
biquad_init ¶
biquad_init :: proc "c" (pConfig: ^biquad_config, pAllocationCallbacks: ^allocation_callbacks, pBQ: ^biquad) -> result ---
biquad_init_preallocated ¶
biquad_init_preallocated :: proc "c" (pConfig: ^biquad_config, pHeap: rawptr, pBQ: ^biquad) -> result ---
biquad_node_config_init ¶
biquad_node_config_init :: proc "c" ( channels: u32, b0, b1, b2, a0, a1, a2: f32, ) -> biquad_node_config ---
biquad_node_init ¶
biquad_node_init :: proc "c" (pNodeGraph: ^node_graph, pConfig: ^biquad_node_config, pAllocationCallbacks: ^allocation_callbacks, pNode: ^biquad_node) -> result ---
biquad_node_reinit ¶
biquad_node_reinit :: proc "c" (pConfig: ^biquad_config, pNode: ^biquad_node) -> result ---
biquad_node_uninit ¶
biquad_node_uninit :: proc "c" (pNode: ^biquad_node, pAllocationCallbacks: ^allocation_callbacks) ---
biquad_reinit ¶
biquad_reinit :: proc "c" (pConfig: ^biquad_config, pBQ: ^biquad) -> result ---
biquad_uninit ¶
biquad_uninit :: proc "c" (pBQ: ^biquad, pAllocationCallbacks: ^allocation_callbacks) ---
blend_f32 ¶
Blends two frames in floating point format.
bpf2_config_init ¶
bpf2_config_init :: proc "c" (format: format, channels: u32, sampleRate: u32, cutoffFrequency, q: f64) -> bpf2_config ---
bpf2_get_heap_size ¶
bpf2_get_heap_size :: proc "c" (pConfig: ^bpf2_config, pHeapSizeInBytes: ^uint) -> result ---
bpf2_init ¶
bpf2_init :: proc "c" (pConfig: ^bpf2_config, pAllocationCallbacks: ^allocation_callbacks, pBPF: ^bpf2) -> result ---
bpf2_init_preallocated ¶
bpf2_init_preallocated :: proc "c" (pConfig: ^bpf2_config, pHeap: rawptr, pBPF: ^bpf2) -> result ---
bpf2_reinit ¶
bpf2_reinit :: proc "c" (pConfig: ^bpf2_config, pBPF: ^bpf2) -> result ---
bpf2_uninit ¶
bpf2_uninit :: proc "c" (pBPF: ^bpf2, pAllocationCallbacks: ^allocation_callbacks) ---
bpf_get_heap_size ¶
bpf_get_heap_size :: proc "c" (pConfig: ^bpf_config, pHeapSizeInBytes: ^uint) -> result ---
bpf_init ¶
bpf_init :: proc "c" (pConfig: ^bpf_config, pAllocationCallbacks: ^allocation_callbacks, pBPF: ^bpf) -> result ---
bpf_init_preallocated ¶
bpf_init_preallocated :: proc "c" (pConfig: ^bpf_config, pHeap: rawptr, pBPF: ^bpf) -> result ---
bpf_node_config_init ¶
bpf_node_config_init :: proc "c" (channels, sampleRate: u32, cutoffFrequency: f64, order: u32) -> bpf_node_config ---
bpf_node_init ¶
bpf_node_init :: proc "c" (pNodeGraph: ^node_graph, pConfig: ^bpf_node_config, pAllocationCallbacks: ^allocation_callbacks, pNode: ^bpf_node) -> result ---
bpf_node_reinit ¶
bpf_node_reinit :: proc "c" (pConfig: ^bpf_config, pNode: ^bpf_node) -> result ---
bpf_node_uninit ¶
bpf_node_uninit :: proc "c" (pNode: ^bpf_node, pAllocationCallbacks: ^allocation_callbacks) ---
bpf_reinit ¶
bpf_reinit :: proc "c" (pConfig: ^bpf_config, pBPF: ^bpf) -> result ---
bpf_uninit ¶
bpf_uninit :: proc "c" (pBPF: ^bpf, pAllocationCallbacks: ^allocation_callbacks) ---
calculate_buffer_size_in_frames_from_descriptor ¶
calculate_buffer_size_in_frames_from_descriptor :: proc "c" (pDescriptor: ^device_descriptor, nativeSampleRate: u32, performanceProfile: performance_profile) -> u32 ---
Calculates an appropriate buffer size from a descriptor, native sample rate and performance profile.
This function is used by backends for helping determine an appropriately sized buffer to use with
the device depending on the values of periodSizeInFrames
and periodSizeInMilliseconds
in the
pDescriptor
object. Since buffer size calculations based on time depends on the sample rate, a
best guess at the device's native sample rate is also required which is where nativeSampleRate
comes in. In addition, the performance profile is also needed for cases where both the period size
in frames and milliseconds are both zero.
Parameters ---------- pDescriptor (in)
A pointer to device descriptor whose `periodSizeInFrames` and `periodSizeInMilliseconds` members will be used for the calculation of the buffer size.
nativeSampleRate (in)
The device's native sample rate. This is only ever used when the `periodSizeInFrames` member of `pDescriptor` is zero. In this case, `periodSizeInMilliseconds` will be used instead, in which case a sample rate is required to convert to a size in frames.
performanceProfile (in)
When both the `periodSizeInFrames` and `periodSizeInMilliseconds` members of `pDescriptor` are zero, miniaudio will fall back to a buffer size based on the performance profile. The profile to use for this calculation is determine by this parameter.
Return Value ------------ The calculated buffer size in frames.
Thread Safety
-------------
This is safe so long as nothing modifies pDescriptor
at the same time. However, this function
should only ever be called from within the backend's device initialization routine and therefore
shouldn't have any multithreading concerns.
Callback Safety --------------- This is safe to call within the data callback, but there is no reason to ever do this.
Remarks
-------
If nativeSampleRate
is zero, this function will fall back to pDescriptor->sampleRate
. If that
is also zero, MA_DEFAULT_SAMPLE_RATE
will be used instead.
calculate_buffer_size_in_frames_from_milliseconds ¶
calculate_buffer_size_in_frames_from_milliseconds :: proc "c" (bufferSizeInMilliseconds: u32, sampleRate: u32) -> u32 ---
Calculates a buffer size in frames from the specified number of milliseconds and sample rate.
calculate_buffer_size_in_milliseconds_from_frames ¶
calculate_buffer_size_in_milliseconds_from_frames :: proc "c" (bufferSizeInFrames: u32, sampleRate: u32) -> u32 ---
Calculates a buffer size in milliseconds from the specified number of frames and sample rate.
calloc ¶
calloc :: proc "c" (sz: uint, pAllocationCallbacks: ^allocation_callbacks) -> rawptr ---
calloc()
channel_converter_config_init ¶
channel_converter_config_init :: proc "c" ( format: format, channelsIn: u32, pChannelMapIn: [^]channel, channelsOut: u32, pChannelMapOut: [^]channel, mixingMode: channel_mix_mode, ) -> channel_converter_config ---
channel_converter_get_heap_size ¶
channel_converter_get_heap_size :: proc "c" (pConfig: ^channel_converter_config, pHeapSizeInBytes: ^uint) -> result ---
channel_converter_get_input_channel_map ¶
channel_converter_get_input_channel_map :: proc "c" (pConverter: ^channel_converter, pChannelMap: [^]channel, channelMapCap: uint) -> result ---
channel_converter_get_output_channel_map ¶
channel_converter_get_output_channel_map :: proc "c" (pConverter: ^channel_converter, pChannelMap: [^]channel, channelMapCap: uint) -> result ---
channel_converter_init ¶
channel_converter_init :: proc "c" (pConfig: ^channel_converter_config, pAllocationCallbacks: ^allocation_callbacks, pConverter: ^channel_converter) -> result ---
channel_converter_init_preallocated ¶
channel_converter_init_preallocated :: proc "c" (pConfig: ^channel_converter_config, pHeap: rawptr, pConverter: ^channel_converter) -> result ---
channel_converter_process_pcm_frames ¶
channel_converter_process_pcm_frames :: proc "c" (pConverter: ^channel_converter, pFramesOut, pFramesIn: rawptr, frameCount: u64) -> result ---
channel_converter_uninit ¶
channel_converter_uninit :: proc "c" (pConverter: ^channel_converter, pAllocationCallbacks: ^allocation_callbacks) ---
channel_map_contains_channel_position ¶
channel_map_contains_channel_position :: proc "c" (channels: u32, pChannelMap: [^]channel, channelPosition: channel) -> b32 ---
Helper for determining whether or not a channel is present in the given channel map.
The channel map buffer must have a capacity of at least channels
.
channel_map_copy ¶
Copies a channel map.
Both input and output channel map buffers must have a capacity of at at least channels
.
channel_map_copy_or_default ¶
channel_map_copy_or_default :: proc "c" (pOut: [^]channel, channelMapCapOut: uint, pIn: [^]channel, channels: u32) ---
Copies a channel map if one is specified, otherwise copies the default channel map.
The output buffer must have a capacity of at least channels
. If not NULL, the input channel map must also have a capacity of at least channels
.
channel_map_find_channel_position ¶
channel_map_find_channel_position :: proc "c" (channels: u32, pChannelMap: [^]channel, channelPosition: channel, pChannelIndex: ^u32) -> b32 ---
Find a channel position in the given channel map. Returns MA_TRUE if the channel is found; MA_FALSE otherwise. The
index of the channel is output to pChannelIndex
.
The channel map buffer must have a capacity of at least channels
.
channel_map_get_channel ¶
channel_map_get_channel :: proc "c" (pChannelMap: [^]channel, channelCount: u32, channelIndex: u32) -> channel ---
Retrieves the channel position of the specified channel in the given channel map.
The pChannelMap parameter can be null, in which case miniaudio's default channel map will be assumed.
channel_map_init_blank ¶
Initializes a blank channel map.
When a blank channel map is specified anywhere it indicates that the native channel map should be used.
channel_map_init_standard ¶
channel_map_init_standard :: proc "c" (standardChannelMap: standard_channel_map, pChannelMap: [^]channel, channelMapCap: uint, channels: u32) ---
Helper for retrieving a standard channel map.
The output channel map buffer must have a capacity of at least channelMapCap
.
channel_map_is_blank ¶
Helper for determining if a channel map is blank (all channels set to MA_CHANNEL_NONE).
The channel map buffer must have a capacity of at least channels
.
channel_map_is_equal ¶
Helper for comparing two channel maps for equality.
This assumes the channel count is the same between the two.
Both channels map buffers must have a capacity of at least channels
.
channel_map_is_valid ¶
Determines whether or not a channel map is valid.
A blank channel map is valid (all channels set to MA_CHANNEL_NONE). The way a blank channel map is handled is context specific, but is usually treated as a passthrough.
Invalid channel maps:
- A channel map with no channels - A channel map with more than one channel and a mono channel
The channel map buffer must have a capacity of at least channels
.
channel_map_to_string ¶
channel_map_to_string :: proc "c" (pChannelMap: [^]channel, channels: u32, pBufferOut: [^]u8, bufferCap: uint) -> uint ---
Generates a string representing the given channel map.
This is for printing and debugging purposes, not serialization/deserialization.
Returns the length of the string, not including the null terminator.
channel_position_to_string ¶
Retrieves a human readable version of a channel position.
clip_samples_u8 ¶
Clips samples.
context_config_init ¶
context_config_init :: proc "c" () -> context_config ---
Initializes a ma_context_config
object.
Return Value
------------
A ma_context_config
initialized to defaults.
Remarks
-------
You must always use this to initialize the default state of the ma_context_config
object. Not using this will result in your program breaking when miniaudio
is updated and new members are added to ma_context_config
. It also sets logical defaults.
You can override members of the returned object by changing it's members directly.
See Also -------- ma_context_init()
context_enumerate_devices ¶
context_enumerate_devices :: proc "c" (pContext: ^context_type, callback: enum_devices_callback_proc, pUserData: rawptr) -> result ---
Enumerates over every device (both playback and capture).
This is a lower-level enumeration function to the easier to use ma_context_get_devices()
. Use ma_context_enumerate_devices()
if you would rather not incur
an internal heap allocation, or it simply suits your code better.
Note that this only retrieves the ID and name/description of the device. The reason for only retrieving basic information is that it would otherwise require
opening the backend device in order to probe it for more detailed information which can be inefficient. Consider using ma_context_get_device_info()
for this,
but don't call it from within the enumeration callback.
Returning false from the callback will stop enumeration. Returning true will continue enumeration.
Parameters ---------- pContext (in)
A pointer to the context performing the enumeration.
callback (in)
The callback to fire for each enumerated device.
pUserData (in)
A pointer to application-defined data passed to the callback.
Return Value ------------ MA_SUCCESS if successful; any other error code otherwise.
Thread Safety ------------- Safe. This is guarded using a simple mutex lock.
Remarks ------- Do _not_ assume the first enumerated device of a given type is the default device.
Some backends and platforms may only support default playback and capture devices.
In general, you should not do anything complicated from within the callback. In particular, do not try initializing a device from within the callback. Also,
do not try to call ma_context_get_device_info()
from within the callback.
Consider using ma_context_get_devices()
for a simpler and safer API, albeit at the expense of an internal heap allocation.
Example 1 - Simple Enumeration ------------------------------ ma_bool32 ma_device_enum_callback(ma_context pContext, ma_device_type deviceType, const ma_device_info pInfo, void* pUserData) {
printf("Device Name: %s\n", pInfo->name); return MA_TRUE;
}
ma_result result = ma_context_enumerate_devices(&context, my_device_enum_callback, pMyUserData); if (result != MA_SUCCESS) {
// Error.
}
See Also -------- ma_context_get_devices()
context_get_device_info ¶
context_get_device_info :: proc "c" (pContext: ^context_type, deviceType: device_type, pDeviceID: ^device_id, pDeviceInfo: ^device_info) -> result ---
Retrieves information about a device of the given type, with the specified ID and share mode.
Parameters ---------- pContext (in)
A pointer to the context performing the query.
deviceType (in)
The type of the device being queried. Must be either `ma_device_type_playback` or `ma_device_type_capture`.
pDeviceID (in)
The ID of the device being queried.
pDeviceInfo (out)
A pointer to the `ma_device_info` structure that will receive the device information.
Return Value ------------ MA_SUCCESS if successful; any other error code otherwise.
Thread Safety ------------- Safe. This is guarded using a simple mutex lock.
Remarks
-------
Do _not_ call this from within the ma_context_enumerate_devices()
callback.
It's possible for a device to have different information and capabilities depending on whether or not it's opened in shared or exclusive mode. For example, in shared mode, WASAPI always uses floating point samples for mixing, but in exclusive mode it can be anything. Therefore, this function allows you to specify which share mode you want information for. Note that not all backends and devices support shared or exclusive mode, in which case this function will fail if the requested share mode is unsupported.
This leaves pDeviceInfo unmodified in the result of an error.
context_get_devices ¶
context_get_devices :: proc "c" (pContext: ^context_type, ppPlaybackDeviceInfos: ^[^]device_info, pPlaybackDeviceCount: ^u32, ppCaptureDeviceInfos: ^[^]device_info, pCaptureDeviceCount: ^u32) -> result ---
Retrieves basic information about every active playback and/or capture device.
This function will allocate memory internally for the device lists and return a pointer to them through the ppPlaybackDeviceInfos
and ppCaptureDeviceInfos
parameters. If you do not want to incur the overhead of these allocations consider using ma_context_enumerate_devices()
which will instead use a callback.
Parameters ---------- pContext (in)
A pointer to the context performing the enumeration.
ppPlaybackDeviceInfos (out)
A pointer to a pointer that will receive the address of a buffer containing the list of `ma_device_info` structures for playback devices.
pPlaybackDeviceCount (out)
A pointer to an unsigned integer that will receive the number of playback devices.
ppCaptureDeviceInfos (out)
A pointer to a pointer that will receive the address of a buffer containing the list of `ma_device_info` structures for capture devices.
pCaptureDeviceCount (out)
A pointer to an unsigned integer that will receive the number of capture devices.
Return Value ------------ MA_SUCCESS if successful; any other error code otherwise.
Thread Safety ------------- Unsafe. Since each call to this function invalidates the pointers from the previous call, you should not be calling this simultaneously across multiple threads. Instead, you need to make a copy of the returned data with your own higher level synchronization.
Remarks ------- It is _not_ safe to assume the first device in the list is the default device.
You can pass in NULL for the playback or capture lists in which case they'll be ignored.
The returned pointers will become invalid upon the next call this this function, or when the context is uninitialized. Do not free the returned pointers.
See Also -------- ma_context_get_devices()
context_get_log ¶
context_get_log :: proc "c" (pContext: ^context_type) -> log ---
Retrieves a pointer to the log object associated with this context.
Remarks
-------
Pass the returned pointer to ma_log_post()
, ma_log_postv()
or ma_log_postf()
to post a log
message.
Return Value
------------
A pointer to the ma_log
object that the context uses to post log messages. If some error occurs,
NULL will be returned.
context_init ¶
context_init :: proc "c" (backends: [^]backend, backendCount: u32, pConfig: ^context_config, pContext: ^context_type) -> result ---
Initializes a context.
The context is used for selecting and initializing an appropriate backend and to represent the backend at a more global level than that of an individual device. There is one context to many devices, and a device is created from a context. A context is required to enumerate devices.
Parameters ---------- backends (in, optional)
A list of backends to try initializing, in priority order. Can be NULL, in which case it uses default priority order.
backendCount (in, optional)
The number of items in `backend`. Ignored if `backend` is NULL.
pConfig (in, optional)
The context configuration.
pContext (in)
A pointer to the context object being initialized.
Return Value ------------ MA_SUCCESS if successful; any other error code otherwise.
Thread Safety ------------- Unsafe. Do not call this function across multiple threads as some backends read and write to global state.
Remarks
-------
When backends
is NULL, the default priority order will be used. Below is a list of backends in priority order:
|-------------|-----------------------|--------------------------------------------------------| | Name | Enum Name | Supported Operating Systems | |-------------|-----------------------|--------------------------------------------------------| | WASAPI | ma_backend_wasapi | Windows Vista+ | | DirectSound | ma_backend_dsound | Windows XP+ | | WinMM | ma_backend_winmm | Windows XP+ (may work on older versions, but untested) | | Core Audio | ma_backend_coreaudio | macOS, iOS | | ALSA | ma_backend_alsa | Linux | | PulseAudio | ma_backend_pulseaudio | Cross Platform (disabled on Windows, BSD and Android) | | JACK | ma_backend_jack | Cross Platform (disabled on BSD and Android) | | sndio | ma_backend_sndio | OpenBSD | | audio(4) | ma_backend_audio4 | NetBSD, OpenBSD | | OSS | ma_backend_oss | FreeBSD | | AAudio | ma_backend_aaudio | Android 8+ | | OpenSL|ES | ma_backend_opensl | Android (API level 16+) | | Web Audio | ma_backend_webaudio | Web (via Emscripten) | | Null | ma_backend_null | Cross Platform (not used on Web) | |-------------|-----------------------|--------------------------------------------------------|
The context can be configured via the pConfig
argument. The config object is initialized with ma_context_config_init()
. Individual configuration settings
can then be set directly on the structure. Below are the members of the ma_context_config
object.
pLog A pointer to the `ma_log` to post log messages to. Can be NULL if the application does not require logging. See the `ma_log` API for details on how to use the logging system. threadPriority The desired priority to use for the audio thread. Allowable values include the following: |--------------------------------------| | Thread Priority | |--------------------------------------| | ma_thread_priority_idle | | ma_thread_priority_lowest | | ma_thread_priority_low | | ma_thread_priority_normal | | ma_thread_priority_high | | ma_thread_priority_highest (default) | | ma_thread_priority_realtime | | ma_thread_priority_default | |--------------------------------------| threadStackSize The desired size of the stack for the audio thread. Defaults to the operating system's default. pUserData A pointer to application-defined data. This can be accessed from the context object directly such as `context.pUserData`. allocationCallbacks Structure containing custom allocation callbacks. Leaving this at defaults will cause it to use MA_MALLOC, MA_REALLOC and MA_FREE. These allocation callbacks will be used for anything tied to the context, including devices. alsa.useVerboseDeviceEnumeration ALSA will typically enumerate many different devices which can be intrusive and not user-friendly. To combat this, miniaudio will enumerate only unique card/device pairs by default. The problem with this is that you lose a bit of flexibility and control. Setting alsa.useVerboseDeviceEnumeration makes it so the ALSA backend includes all devices. Defaults to false. pulse.pApplicationName PulseAudio only. The application name to use when initializing the PulseAudio context with `pa_context_new()`. pulse.pServerName PulseAudio only. The name of the server to connect to with `pa_context_connect()`. pulse.tryAutoSpawn PulseAudio only. Whether or not to try automatically starting the PulseAudio daemon. Defaults to false. If you set this to true, keep in mind that miniaudio uses a trial and error method to find the most appropriate backend, and this will result in the PulseAudio daemon starting which may be intrusive for the end user. coreaudio.sessionCategory iOS only. The session category to use for the shared AudioSession instance. Below is a list of allowable values and their Core Audio equivalents. |-----------------------------------------|-------------------------------------| | miniaudio Token | Core Audio Token | |-----------------------------------------|-------------------------------------| | ma_ios_session_category_ambient | AVAudioSessionCategoryAmbient | | ma_ios_session_category_solo_ambient | AVAudioSessionCategorySoloAmbient | | ma_ios_session_category_playback | AVAudioSessionCategoryPlayback | | ma_ios_session_category_record | AVAudioSessionCategoryRecord | | ma_ios_session_category_play_and_record | AVAudioSessionCategoryPlayAndRecord | | ma_ios_session_category_multi_route | AVAudioSessionCategoryMultiRoute | | ma_ios_session_category_none | AVAudioSessionCategoryAmbient | | ma_ios_session_category_default | AVAudioSessionCategoryAmbient | |-----------------------------------------|-------------------------------------| coreaudio.sessionCategoryOptions iOS only. Session category options to use with the shared AudioSession instance. Below is a list of allowable values and their Core Audio equivalents. |---------------------------------------------------------------------------|------------------------------------------------------------------| | miniaudio Token | Core Audio Token | |---------------------------------------------------------------------------|------------------------------------------------------------------| | ma_ios_session_category_option_mix_with_others | AVAudioSessionCategoryOptionMixWithOthers | | ma_ios_session_category_option_duck_others | AVAudioSessionCategoryOptionDuckOthers | | ma_ios_session_category_option_allow_bluetooth | AVAudioSessionCategoryOptionAllowBluetooth | | ma_ios_session_category_option_default_to_speaker | AVAudioSessionCategoryOptionDefaultToSpeaker | | ma_ios_session_category_option_interrupt_spoken_audio_and_mix_with_others | AVAudioSessionCategoryOptionInterruptSpokenAudioAndMixWithOthers | | ma_ios_session_category_option_allow_bluetooth_a2dp | AVAudioSessionCategoryOptionAllowBluetoothA2DP | | ma_ios_session_category_option_allow_air_play | AVAudioSessionCategoryOptionAllowAirPlay | |---------------------------------------------------------------------------|------------------------------------------------------------------| coreaudio.noAudioSessionActivate iOS only. When set to true, does not perform an explicit [[AVAudioSession sharedInstace] setActive:true] on initialization. coreaudio.noAudioSessionDeactivate iOS only. When set to true, does not perform an explicit [[AVAudioSession sharedInstace] setActive:false] on uninitialization. jack.pClientName The name of the client to pass to `jack_client_open()`. jack.tryStartServer Whether or not to try auto-starting the JACK server. Defaults to false.
It is recommended that only a single context is active at any given time because it's a bulky data structure which performs run-time linking for the relevant backends every time it's initialized.
The location of the context cannot change throughout it's lifetime. Consider allocating the ma_context
object with malloc()
if this is an issue. The
reason for this is that a pointer to the context is stored in the ma_device
structure.
Example 1 - Default Initialization ---------------------------------- The example below shows how to initialize the context using the default configuration.
`c
ma_context context;
ma_result result = ma_context_init(NULL, 0, NULL, &context);
if (result != MA_SUCCESS) {
// Error.
}
`
Example 2 - Custom Configuration -------------------------------- The example below shows how to initialize the context using custom backend priorities and a custom configuration. In this hypothetical example, the program wants to prioritize ALSA over PulseAudio on Linux. They also want to avoid using the WinMM backend on Windows because it's latency is too high. They also want an error to be returned if no valid backend is available which they achieve by excluding the Null backend.
For the configuration, the program wants to capture any log messages so they can, for example, route it to a log file and user interface.
`c
ma_backend backends[] = {
ma_backend_alsa, ma_backend_pulseaudio, ma_backend_wasapi, ma_backend_dsound
};
ma_log log; ma_log_init(&log); ma_log_register_callback(&log, ma_log_callback_init(my_log_callbac, pMyLogUserData));
ma_context_config config = ma_context_config_init(); config.pLog = &log; // Specify a custom log object in the config so any logs that are posted from ma_context_init() are captured.
ma_context context; ma_result result = ma_context_init(backends, sizeof(backends)/sizeof(backends[0]), &config, &context); if (result != MA_SUCCESS) {
// Error. if (result == MA_NO_BACKEND) { // Couldn't find an appropriate backend. }
}
// You could also attach a log callback post-initialization:
ma_log_register_callback(ma_context_get_log(&context), ma_log_callback_init(my_log_callback, pMyLogUserData));
`
See Also -------- ma_context_config_init() ma_context_uninit()
context_is_loopback_supported ¶
context_is_loopback_supported :: proc "c" (pContext: ^context_type) -> b32 ---
Determines if the given context supports loopback mode.
Parameters ---------- pContext (in) A pointer to the context getting queried.
Return Value ------------ MA_TRUE if the context supports loopback mode; MA_FALSE otherwise.
context_sizeof ¶
context_sizeof :: proc "c" () -> uint ---
Retrieves the size of the ma_context object.
This is mainly for the purpose of bindings to know how much memory to allocate.
context_uninit ¶
context_uninit :: proc "c" (pContext: ^context_type) -> result ---
Uninitializes a context.
Return Value ------------ MA_SUCCESS if successful; any other error code otherwise.
Thread Safety ------------- Unsafe. Do not call this function across multiple threads as some backends read and write to global state.
Remarks ------- Results are undefined if you call this while any device created by this context is still active.
See Also -------- ma_context_init()
convert_frames ¶
convert_frames :: proc "c" ( pOut: rawptr, frameCountOut: u64, formatOut: format, channelsOut: u32, sampleRateOut: u32, pIn: rawptr, frameCountIn: u64, formatIn: format, channelsIn: u32, sampleRateIn: u32, ) -> u64 ---
High-level helper for doing a full format conversion in one go. Returns the number of output frames. Call this with pOut set to NULL to determine the required size of the output buffer. frameCountOut should be set to the capacity of pOut. If pOut is NULL, frameCountOut is ignored.
A return value of 0 indicates an error.
This function is useful for one-off bulk conversions, but if you're streaming data you should use the ma_data_converter APIs instead.
copy_and_apply_volume_factor_u8 ¶
copy_and_apply_volume_factor_u8 :: proc "c" (pSamplesOut, pSamplesIn: [^]u8, sampleCount: u64, factor: f64) ---
Helper for applying a volume factor to samples.
Note that the source and destination buffers can be the same, in which case it'll perform the operation in-place.
copy_pcm_frames ¶
copy_pcm_frames :: proc "c" (dst: rawptr, src: rawptr, frameCount: u64, format: format, channels: u32) ---
Copies PCM frames from one buffer to another.
data_converter_config_init ¶
data_converter_config_init :: proc "c" ( formatIn, formatOut: format, channelsIn, channelsOut: u32, sampleRateIn, sampleRateOut: u32, ) -> data_converter_config ---
data_converter_config_init_default ¶
data_converter_config_init_default :: proc "c" () -> data_converter_config ---
data_converter_get_expected_output_frame_count ¶
data_converter_get_expected_output_frame_count :: proc "c" (pConverter: ^data_converter, inputFrameCount: u64, pOutputFrameCount: ^u64) -> result ---
data_converter_get_heap_size ¶
data_converter_get_heap_size :: proc "c" (pConfig: ^data_converter_config, pHeapSizeInBytes: ^uint) -> result ---
data_converter_get_input_channel_map ¶
data_converter_get_input_channel_map :: proc "c" (pConverter: ^data_converter, pChannelMap: [^]channel, channelMapCap: uint) -> result ---
data_converter_get_input_latency ¶
data_converter_get_input_latency :: proc "c" (pConverter: ^data_converter) -> u64 ---
data_converter_get_output_channel_map ¶
data_converter_get_output_channel_map :: proc "c" (pConverter: ^data_converter, pChannelMap: [^]channel, channelMapCap: uint) -> result ---
data_converter_get_output_latency ¶
data_converter_get_output_latency :: proc "c" (pConverter: ^data_converter) -> u64 ---
data_converter_get_required_input_frame_count ¶
data_converter_get_required_input_frame_count :: proc "c" (pConverter: ^data_converter, outputFrameCount: u64, pInputFrameCount: ^u64) -> result ---
data_converter_init ¶
data_converter_init :: proc "c" (pConfig: ^data_converter_config, pAllocationCallbacks: ^allocation_callbacks, pConverter: ^data_converter) -> result ---
data_converter_init_preallocated ¶
data_converter_init_preallocated :: proc "c" (pConfig: ^data_converter_config, pHeap: rawptr, pConverter: ^data_converter) -> result ---
data_converter_reset ¶
data_converter_reset :: proc "c" (pConverter: ^data_converter) -> result ---
data_converter_set_rate ¶
data_converter_set_rate :: proc "c" (pConverter: ^data_converter, sampleRateIn, sampleRateOut: u32) -> result ---
data_converter_set_rate_ratio ¶
data_converter_set_rate_ratio :: proc "c" (pConverter: ^data_converter, ratioInOut: f32) -> result ---
data_converter_uninit ¶
data_converter_uninit :: proc "c" (pConverter: ^data_converter, pAllocationCallbacks: ^allocation_callbacks) ---
data_source_config_init ¶
data_source_config_init :: proc "c" () -> data_source_config ---
data_source_get_current ¶
data_source_get_current :: proc "c" (pDataSource: ^data_source) -> ^data_source ---
data_source_get_cursor_in_pcm_frames ¶
data_source_get_cursor_in_pcm_frames :: proc "c" (pDataSource: ^data_source, pCursor: ^u64) -> result ---
data_source_get_cursor_in_seconds ¶
data_source_get_cursor_in_seconds :: proc "c" (pDataSource: ^data_source, pCursor: ^f32) -> result ---
data_source_get_length_in_pcm_frames ¶
data_source_get_length_in_pcm_frames :: proc "c" (pDataSource: ^data_source, pLength: ^u64) -> result ---
Returns MA_NOT_IMPLEMENTED if the length is unknown or cannot be determined. Decoders can return this.
data_source_get_length_in_seconds ¶
data_source_get_length_in_seconds :: proc "c" (pDataSource: ^data_source, pLength: ^f32) -> result ---
data_source_get_loop_point_in_pcm_frames ¶
data_source_get_loop_point_in_pcm_frames :: proc "c" (pDataSource: ^data_source, pLoopBegInFrames: ^u64, pLoopEndInFrames: ^u64) ---
data_source_get_next ¶
data_source_get_next :: proc "c" (pDataSource: ^data_source) -> ^data_source ---
data_source_get_next_callback ¶
data_source_get_next_callback :: proc "c" (pDataSource: ^data_source) -> ^data_source_get_next_proc ---
data_source_get_range_in_pcm_frames ¶
data_source_get_range_in_pcm_frames :: proc "c" (pDataSource: ^data_source, pRangeBegInFrames: ^u64, pRangeEndInFrames: ^u64) ---
data_source_init ¶
data_source_init :: proc "c" (pConfig: ^data_source_config, pDataSource: ^data_source) -> result ---
data_source_is_looping ¶
data_source_is_looping :: proc "c" (pDataSource: ^data_source) -> b32 ---
data_source_node_config_init ¶
data_source_node_config_init :: proc "c" (pDataSource: ^data_source) -> data_source_node_config ---
data_source_node_init ¶
data_source_node_init :: proc "c" (pNodeGraph: ^node_graph, pConfig: ^data_source_node_config, pAllocationCallbacks: ^allocation_callbacks, pDataSourceNode: ^data_source_node) -> result ---
data_source_node_is_looping ¶
data_source_node_is_looping :: proc "c" (pDataSourceNode: ^data_source_node) -> b32 ---
data_source_node_set_looping ¶
data_source_node_set_looping :: proc "c" (pDataSourceNode: ^data_source_node, isLooping: b32) -> result ---
data_source_node_uninit ¶
data_source_node_uninit :: proc "c" (pDataSourceNode: ^data_source_node, pAllocationCallbacks: ^allocation_callbacks) ---
data_source_read_pcm_frames ¶
data_source_read_pcm_frames :: proc "c" (pDataSource: ^data_source, pFramesOut: rawptr, frameCount: u64, pFramesRead: ^u64) -> result ---
Must support pFramesOut = NULL in which case a forward seek should be performed.
data_source_seek_pcm_frames ¶
data_source_seek_pcm_frames :: proc "c" (pDataSource: ^data_source, frameCount: u64, pFramesSeeked: ^u64) -> result ---
Can only seek forward. Equivalent to ma_data_source_read_pcm_frames(pDataSource, NULL, frameCount);
data_source_seek_to_pcm_frame ¶
data_source_seek_to_pcm_frame :: proc "c" (pDataSource: ^data_source, frameIndex: u64) -> result ---
data_source_set_current ¶
data_source_set_current :: proc "c" (pDataSource: ^data_source, pCurrentDataSource: ^data_source) -> result ---
data_source_set_loop_point_in_pcm_frames ¶
data_source_set_loop_point_in_pcm_frames :: proc "c" (pDataSource: ^data_source, loopBegInFrames: u64, loopEndInFrames: u64) -> result ---
data_source_set_looping ¶
data_source_set_looping :: proc "c" (pDataSource: ^data_source, isLooping: b32) -> result ---
data_source_set_next ¶
data_source_set_next :: proc "c" (pDataSource: ^data_source, pNextDataSource: ^data_source) -> result ---
data_source_set_next_callback ¶
data_source_set_next_callback :: proc "c" (pDataSource: ^data_source, onGetNext: ^data_source_get_next_proc) -> result ---
data_source_set_range_in_pcm_frames ¶
data_source_set_range_in_pcm_frames :: proc "c" (pDataSource: ^data_source, rangeBegInFrames: u64, rangeEndInFrames: u64) -> result ---
data_source_uninit ¶
data_source_uninit :: proc "c" (pDataSource: ^data_source) ---
decode_file ¶
decode_file :: proc "c" (pFilePath: cstring, pConfig: ^decoder_config, pFrameCountOut: ^u64, ppPCMFramesOut: ^rawptr) -> result ---
decode_from_vfs ¶
decode_from_vfs :: proc "c" (pVFS: ^vfs, pFilePath: cstring, pConfig: ^decoder_config, pFrameCountOut: ^u64, ppPCMFramesOut: ^rawptr) -> result ---
Helper for opening and decoding a file into a heap allocated block of memory. Free the returned pointer with ma_free(). On input, pConfig should be set to what you want. On output it will be set to what you got.
decoder_config_init ¶
decoder_config_init :: proc "c" (outputFormat: format, outputChannels, outputSampleRate: u32) -> decoder_config ---
decoder_config_init_default ¶
decoder_config_init_default :: proc "c" () -> decoder_config ---
decoder_get_available_frames ¶
Retrieves the number of frames that can be read before reaching the end.
This calls ma_decoder_get_length_in_pcm_frames()
so you need to be aware of the rules for that function, in
particular ensuring you do not call it on streams of an undefined length, such as internet radio.
If the total length of the decoder cannot be retrieved, such as with Vorbis decoders, MA_NOT_IMPLEMENTED
will be
returned.
decoder_get_cursor_in_pcm_frames ¶
Retrieves the current position of the read cursor in PCM frames.
decoder_get_data_format ¶
decoder_get_data_format :: proc "c" ( pDecoder: ^decoder, pFormat: ^format, pChannels, pSampleRate: ^u32, pChannelMap: ^channel, channelMapCap: uint, ) -> result ---
Retrieves the decoder's output data format.
decoder_get_length_in_pcm_frames ¶
Retrieves the length of the decoder in PCM frames.
Do not call this on streams of an undefined length, such as internet radio.
If the length is unknown or an error occurs, 0 will be returned.
This will always return 0 for Vorbis decoders. This is due to a limitation with stb_vorbis in push mode which is what miniaudio uses internally.
For MP3's, this will decode the entire file. Do not call this in time critical scenarios.
This function is not thread safe without your own synchronization.
decoder_init ¶
decoder_init :: proc "c" (onRead: decoder_read_proc, onSeek: decoder_seek_proc, pUserData: rawptr, pConfig: ^decoder_config, pDecoder: ^decoder) -> result ---
decoder_init_file ¶
decoder_init_file :: proc "c" (pFilePath: cstring, pConfig: ^decoder_config, pDecoder: ^decoder) -> result ---
decoder_init_file_w ¶
decoder_init_file_w :: proc "c" (pFilePath: [^]u16, pConfig: ^decoder_config, pDecoder: ^decoder) -> result ---
decoder_init_memory ¶
decoder_init_memory :: proc "c" (pData: rawptr, dataSize: uint, pConfig: ^decoder_config, pDecoder: ^decoder) -> result ---
decoder_init_vfs ¶
decoder_init_vfs :: proc "c" (pVFS: ^vfs, pFilePath: cstring, pConfig: ^decoder_config, pDecoder: ^decoder) -> result ---
decoder_init_vfs_w ¶
decoder_init_vfs_w :: proc "c" (pVFS: ^vfs, pFilePath: [^]u16, pConfig: ^decoder_config, pDecoder: ^decoder) -> result ---
decoder_read_pcm_frames ¶
decoder_read_pcm_frames :: proc "c" (pDecoder: ^decoder, pFramesOut: rawptr, frameCount: u64, pFramesRead: ^u64) -> result ---
Reads PCM frames from the given decoder.
This is not thread safe without your own synchronization.
decoder_seek_to_pcm_frame ¶
Seeks to a PCM frame based on it's absolute index.
This is not thread safe without your own synchronization.
decoder_uninit ¶
Uninitializes a decoder.
decoding_backend_config_init ¶
decoding_backend_config_init :: proc "c" (preferredFormat: format, seekPointCount: u32) -> decoding_backend_config ---
default_vfs_init ¶
default_vfs_init :: proc "c" (pVFS: ^default_vfs, pAllocationCallbacks: ^allocation_callbacks) -> result ---
deinterleave_pcm_frames ¶
deinterleave_pcm_frames :: proc "c" (format: format, channels: u32, frameCount: u64, pInterleavedPCMFrames: rawptr, ppDeinterleavedPCMFrames: ^rawptr) ---
Deinterleaves an interleaved buffer.
delay_config_init ¶
delay_config_init :: proc "c" (channels, sampleRate, delayInFrames: u32, decay: f32) -> delay_config ---
delay_init ¶
delay_init :: proc "c" (pConfig: ^delay_config, pAllocationCallbacks: ^allocation_callbacks, pDelay: ^delay) -> result ---
delay_node_config_init ¶
delay_node_config_init :: proc "c" (channels, sampleRate, delayInFrames: u32, decay: f32) -> delay_node_config ---
delay_node_get_decay ¶
delay_node_get_decay :: proc "c" (pDelayNode: ^delay_node) -> f32 ---
delay_node_get_dry ¶
delay_node_get_dry :: proc "c" (pDelayNode: ^delay_node) -> f32 ---
delay_node_get_wet ¶
delay_node_get_wet :: proc "c" (pDelayNode: ^delay_node) -> f32 ---
delay_node_init ¶
delay_node_init :: proc "c" (pNodeGraph: ^node_graph, pConfig: ^delay_node_config, pAllocationCallbacks: ^allocation_callbacks, pDelayNode: ^delay_node) -> result ---
delay_node_set_decay ¶
delay_node_set_decay :: proc "c" (pDelayNode: ^delay_node, value: f32) ---
delay_node_set_dry ¶
delay_node_set_dry :: proc "c" (pDelayNode: ^delay_node, value: f32) ---
delay_node_set_wet ¶
delay_node_set_wet :: proc "c" (pDelayNode: ^delay_node, value: f32) ---
delay_node_uninit ¶
delay_node_uninit :: proc "c" (pDelayNode: ^delay_node, pAllocationCallbacks: ^allocation_callbacks) ---
delay_uninit ¶
delay_uninit :: proc "c" (pDelay: ^delay, pAllocationCallbacks: ^allocation_callbacks) ---
device_config_init ¶
device_config_init :: proc "c" (deviceType: device_type) -> device_config ---
Initializes a device config with default settings.
Parameters ---------- deviceType (in)
The type of the device this config is being initialized for. This must set to one of the following: |-------------------------| | Device Type | |-------------------------| | ma_device_type_playback | | ma_device_type_capture | | ma_device_type_duplex | | ma_device_type_loopback | |-------------------------|
Return Value ------------ A new device config object with default settings. You will typically want to adjust the config after this function returns. See remarks.
Thread Safety ------------- Safe.
Callback Safety --------------- Safe, but don't try initializing a device in a callback.
Remarks ------- The returned config will be initialized to defaults. You will normally want to customize a few variables before initializing the device. See Example 1 for a typical configuration which sets the sample format, channel count, sample rate, data callback and user data. These are usually things you will want to change before initializing the device.
See ma_device_init()
for details on specific configuration options.
Example 1 - Simple Configuration
--------------------------------
The example below is what a program will typically want to configure for each device at a minimum. Notice how ma_device_config_init()
is called first, and
then the returned object is modified directly. This is important because it ensures that your program continues to work as new configuration options are added
to the ma_device_config
structure.
`c
ma_device_config config = ma_device_config_init(ma_device_type_playback);
config.playback.format = ma_format_f32;
config.playback.channels = 2;
config.sampleRate = 48000;
config.dataCallback = ma_data_callback;
config.pUserData = pMyUserData;
`
See Also -------- ma_device_init() ma_device_init_ex()
device_get_context ¶
device_get_context :: proc "c" (pDevice: ^device) -> ^context_type ---
Retrieves a pointer to the context that owns the given device.
device_get_info ¶
device_get_info :: proc "c" (pDevice: ^device, type: device_type, pDeviceInfo: ^device_info) -> result ---
Retrieves information about the device.
Parameters ---------- pDevice (in)
A pointer to the device whose information is being retrieved.
type (in)
The device type. This parameter is required for duplex devices. When retrieving device information, you are doing so for an individual playback or capture device.
pDeviceInfo (out)
A pointer to the `ma_device_info` that will receive the device information.
Return Value ------------ MA_SUCCESS if successful; any other error code otherwise.
Thread Safety ------------- Unsafe. This should be considered unsafe because it may be calling into the backend which may or may not be safe.
Callback Safety --------------- Unsafe. You should avoid calling this in the data callback because it may call into the backend which may or may not be safe.
device_get_log ¶
Helper function for retrieving the log object associated with the context that owns this device.
device_get_master_volume ¶
Retrieves the master volume factor for the device.
Parameters ---------- pDevice (in)
A pointer to the device whose volume factor is being retrieved.
pVolume (in)
A pointer to the variable that will receive the volume factor. The returned value will be in the range of [0, 1].
Return Value ------------ MA_SUCCESS if successful. MA_INVALID_ARGS if pDevice is NULL. MA_INVALID_ARGS if pVolume is NULL.
Thread Safety ------------- Safe. This just a simple member retrieval.
Callback Safety --------------- Safe.
Remarks
-------
If an error occurs, *pVolume
will be set to 0.
See Also -------- ma_device_set_master_volume() ma_device_set_master_volume_gain_db() ma_device_get_master_volume_gain_db()
device_get_master_volume_db ¶
Retrieves the master gain in decibels.
Parameters ---------- pDevice (in)
A pointer to the device whose gain is being retrieved.
pGainDB (in)
A pointer to the variable that will receive the gain in decibels. The returned value will be <= 0.
Return Value ------------ MA_SUCCESS if successful. MA_INVALID_ARGS if pDevice is NULL. MA_INVALID_ARGS if pGainDB is NULL.
Thread Safety ------------- Safe. This just a simple member retrieval.
Callback Safety --------------- Safe.
Remarks
-------
If an error occurs, *pGainDB
will be set to 0.
See Also -------- ma_device_set_master_volume_db() ma_device_set_master_volume() ma_device_get_master_volume()
device_get_name ¶
device_get_name :: proc "c" (pDevice: ^device, type: device_type, pName: [^]u8, nameCap: uint, pLengthNotIncludingNullTerminator: ^uint) -> result ---
Retrieves the name of the device.
Parameters ---------- pDevice (in)
A pointer to the device whose information is being retrieved.
type (in)
The device type. This parameter is required for duplex devices. When retrieving device information, you are doing so for an individual playback or capture device.
pName (out)
A pointer to the buffer that will receive the name.
nameCap (in)
The capacity of the output buffer, including space for the null terminator.
pLengthNotIncludingNullTerminator (out, optional)
A pointer to the variable that will receive the length of the name, not including the null terminator.
Return Value ------------ MA_SUCCESS if successful; any other error code otherwise.
Thread Safety ------------- Unsafe. This should be considered unsafe because it may be calling into the backend which may or may not be safe.
Callback Safety --------------- Unsafe. You should avoid calling this in the data callback because it may call into the backend which may or may not be safe.
Remarks
-------
If the name does not fully fit into the output buffer, it'll be truncated. You can pass in NULL to
pName
if you want to first get the length of the name for the purpose of memory allocation of the
output buffer. Allocating a buffer of size MA_MAX_DEVICE_NAME_LENGTH + 1
should be enough for
most cases and will avoid the need for the inefficiency of calling this function twice.
This is implemented in terms of ma_device_get_info()
.
device_get_state ¶
device_get_state :: proc "c" (pDevice: ^device) -> device_state ---
Retrieves the state of the device.
Parameters ---------- pDevice (in)
A pointer to the device whose state is being retrieved.
Return Value ------------ The current state of the device. The return value will be one of the following:
+-------------------------------+------------------------------------------------------------------------------+ | ma_device_state_uninitialized | Will only be returned if the device is in the middle of initialization. | +-------------------------------+------------------------------------------------------------------------------+ | ma_device_state_stopped | The device is stopped. The initial state of the device after initialization. | +-------------------------------+------------------------------------------------------------------------------+ | ma_device_state_started | The device started and requesting and/or delivering audio data. | +-------------------------------+------------------------------------------------------------------------------+ | ma_device_state_starting | The device is in the process of starting. | +-------------------------------+------------------------------------------------------------------------------+ | ma_device_state_stopping | The device is in the process of stopping. | +-------------------------------+------------------------------------------------------------------------------+
Thread Safety ------------- Safe. This is implemented as a simple accessor. Note that if the device is started or stopped at the same time as this function is called, there's a possibility the return value could be out of sync. See remarks.
Callback Safety --------------- Safe. This is implemented as a simple accessor.
Remarks ------- The general flow of a devices state goes like this:
``` ma_device_init() -> ma_device_state_uninitialized -> ma_device_state_stopped ma_device_start() -> ma_device_state_starting -> ma_device_state_started ma_device_stop() -> ma_device_state_stopping -> ma_device_state_stopped ```
When the state of the device is changed with ma_device_start()
or ma_device_stop()
at this same time as this function is called, the
value returned by this function could potentially be out of sync. If this is significant to your program you need to implement your own
synchronization.
device_handle_backend_data_callback ¶
device_handle_backend_data_callback :: proc "c" (pDevice: ^device, pOutput, pInput: rawptr, frameCount: u32) -> result ---
Called from the data callback of asynchronous backends to allow miniaudio to process the data and fire the miniaudio data callback.
Parameters ---------- pDevice (in)
A pointer to device whose processing the data callback.
pOutput (out)
A pointer to the buffer that will receive the output PCM frame data. On a playback device this must not be NULL. On a duplex device this can be NULL, in which case pInput must not be NULL.
pInput (in)
A pointer to the buffer containing input PCM frame data. On a capture device this must not be NULL. On a duplex device this can be NULL, in which case `pOutput` must not be NULL.
frameCount (in)
The number of frames being processed.
Return Value ------------ MA_SUCCESS if successful; any other result code otherwise.
Thread Safety ------------- This function should only ever be called from the internal data callback of the backend. It is safe to call this simultaneously between a playback and capture device in duplex setups.
Callback Safety --------------- Do not call this from the miniaudio data callback. It should only ever be called from the internal data callback of the backend.
Remarks
-------
If both pOutput
and pInput
are NULL, and error will be returned. In duplex scenarios, both pOutput
and pInput
can be non-NULL, in
which case pInput
will be processed first, followed by pOutput
.
If you are implementing a custom backend, and that backend uses a callback for data delivery, you'll need to call this from inside that callback.
device_init ¶
device_init :: proc "c" (pContext: ^context_type, pConfig: ^device_config, pDevice: ^device) -> result ---
Initializes a device. A device represents a physical audio device. The idea is you send or receive audio data from the device to either play it back through a speaker, or capture it from a microphone. Whether or not you should send or receive data from the device (or both) depends on the type of device you are initializing which can be playback, capture, full-duplex or loopback. (Note that loopback mode is only supported on select backends.) Sending and receiving audio data to and from the device is done via a callback which is fired by miniaudio at periodic time intervals. The frequency at which data is delivered to and from a device depends on the size of it's period. The size of the period can be defined in terms of PCM frames or milliseconds, whichever is more convenient. Generally speaking, the smaller the period, the lower the latency at the expense of higher CPU usage and increased risk of glitching due to the more frequent and granular data deliver intervals. The size of a period will depend on your requirements, but miniaudio's defaults should work fine for most scenarios. If you're building a game you should leave this fairly small, whereas if you're building a simple media player you can make it larger. Note that the period size you request is actually just a hint - miniaudio will tell the backend what you want, but the backend is ultimately responsible for what it gives you. You cannot assume you will get exactly what you ask for. When delivering data to and from a device you need to make sure it's in the correct format which you can set through the device configuration. You just set the format that you want to use and miniaudio will perform all of the necessary conversion for you internally. When delivering data to and from the callback you can assume the format is the same as what you requested when you initialized the device. See Remarks for more details on miniaudio's data conversion pipeline. Parameters ---------- pContext (in, optional) A pointer to the context that owns the device. This can be null, in which case it creates a default context internally. pConfig (in) A pointer to the device configuration. Cannot be null. See remarks for details. pDevice (out) A pointer to the device object being initialized. Return Value ------------ MA_SUCCESS if successful; any other error code otherwise. Thread Safety ------------- Unsafe. It is not safe to call this function simultaneously for different devices because some backends depend on and mutate global state. The same applies to calling this at the same time as `ma_device_uninit()`. Callback Safety --------------- Unsafe. It is not safe to call this inside any callback. Remarks ------- Setting `pContext` to NULL will result in miniaudio creating a default context internally and is equivalent to passing in a context initialized like so: ```c ma_context_init(NULL, 0, NULL, &context); ``` Do not set `pContext` to NULL if you are needing to open multiple devices. You can, however, use NULL when initializing the first device, and then use device.pContext for the initialization of other devices. The device can be configured via the `pConfig` argument. The config object is initialized with `ma_device_config_init()`. Individual configuration settings can then be set directly on the structure. Below are the members of the `ma_device_config` object. deviceType Must be `ma_device_type_playback`, `ma_device_type_capture`, `ma_device_type_duplex` of `ma_device_type_loopback`. sampleRate The sample rate, in hertz. The most common sample rates are 48000 and 44100. Setting this to 0 will use the device's native sample rate. periodSizeInFrames The desired size of a period in PCM frames. If this is 0, `periodSizeInMilliseconds` will be used instead. If both are 0 the default buffer size will be used depending on the selected performance profile. This value affects latency. See below for details. periodSizeInMilliseconds The desired size of a period in milliseconds. If this is 0, `periodSizeInFrames` will be used instead. If both are 0 the default buffer size will be used depending on the selected performance profile. The value affects latency. See below for details. periods The number of periods making up the device's entire buffer. The total buffer size is `periodSizeInFrames` or `periodSizeInMilliseconds` multiplied by this value. This is just a hint as backends will be the ones who ultimately decide how your periods will be configured. performanceProfile A hint to miniaudio as to the performance requirements of your program. Can be either `ma_performance_profile_low_latency` (default) or `ma_performance_profile_conservative`. This mainly affects the size of default buffers and can usually be left at it's default value. noPreSilencedOutputBuffer When set to true, the contents of the output buffer passed into the data callback will be left undefined. When set to false (default), the contents of the output buffer will be cleared the zero. You can use this to avoid the overhead of zeroing out the buffer if you can guarantee that your data callback will write to every sample in the output buffer, or if you are doing your own clearing. noClip
When set to true, the contents of the output buffer are left alone after returning and it will be left up to the backend itself to decide whether or not to clip. When set to false (default), the contents of the output buffer passed into the data callback will be clipped after returning. This only
applies when the playback sample format is f32. noDisableDenormals By default, miniaudio will disable denormals when the data callback is called. Setting this to true will prevent the disabling of denormals. noFixedSizedCallback
Allows miniaudio to fire the data callback with any frame count. When this is set to false (the default), the data callback will be fired with a
consistent frame count as specified by periodSizeInFrames
or periodSizeInMilliseconds
. When set to true, miniaudio will fire the callback with
whatever the backend requests, which could be anything.
dataCallback The callback to fire whenever data is ready to be delivered to or from the device. notificationCallback The callback to fire when something has changed with the device, such as whether or not it has been started or stopped. pUserData The user data pointer to use with the device. You can access this directly from the device object like `device.pUserData`. resampling.algorithm The resampling algorithm to use when miniaudio needs to perform resampling between the rate specified by `sampleRate` and the device's native rate. The default value is `ma_resample_algorithm_linear`, and the quality can be configured with `resampling.linear.lpfOrder`. resampling.pBackendVTable A pointer to an optional vtable that can be used for plugging in a custom resampler. resampling.pBackendUserData A pointer that will passed to callbacks in pBackendVTable. resampling.linear.lpfOrder The linear resampler applies a low-pass filter as part of it's processing for anti-aliasing. This setting controls the order of the filter. The higher the value, the better the quality, in general. Setting this to 0 will disable low-pass filtering altogether. The maximum value is `MA_MAX_FILTER_ORDER`. The default value is `min(4, MA_MAX_FILTER_ORDER)`. playback.pDeviceID A pointer to a `ma_device_id` structure containing the ID of the playback device to initialize. Setting this NULL (default) will use the system's default playback device. Retrieve the device ID from the `ma_device_info` structure, which can be retrieved using device enumeration. playback.format The sample format to use for playback. When set to `ma_format_unknown` the device's native format will be used. This can be retrieved after initialization from the device object directly with `device.playback.format`. playback.channels The number of channels to use for playback. When set to 0 the device's native channel count will be used. This can be retrieved after initialization from the device object directly with `device.playback.channels`. playback.pChannelMap The channel map to use for playback. When left empty, the device's native channel map will be used. This can be retrieved after initialization from the device object direct with `device.playback.pChannelMap`. When set, the buffer should contain `channels` items. playback.shareMode The preferred share mode to use for playback. Can be either `ma_share_mode_shared` (default) or `ma_share_mode_exclusive`. Note that if you specify exclusive mode, but it's not supported by the backend, initialization will fail. You can then fall back to shared mode if desired by changing this to ma_share_mode_shared and reinitializing. capture.pDeviceID A pointer to a `ma_device_id` structure containing the ID of the capture device to initialize. Setting this NULL (default) will use the system's default capture device. Retrieve the device ID from the `ma_device_info` structure, which can be retrieved using device enumeration. capture.format The sample format to use for capture. When set to `ma_format_unknown` the device's native format will be used. This can be retrieved after initialization from the device object directly with `device.capture.format`. capture.channels The number of channels to use for capture. When set to 0 the device's native channel count will be used. This can be retrieved after initialization from the device object directly with `device.capture.channels`. capture.pChannelMap The channel map to use for capture. When left empty, the device's native channel map will be used. This can be retrieved after initialization from the device object direct with `device.capture.pChannelMap`. When set, the buffer should contain `channels` items. capture.shareMode The preferred share mode to use for capture. Can be either `ma_share_mode_shared` (default) or `ma_share_mode_exclusive`. Note that if you specify exclusive mode, but it's not supported by the backend, initialization will fail. You can then fall back to shared mode if desired by changing this to ma_share_mode_shared and reinitializing. wasapi.noAutoConvertSRC WASAPI only. When set to true, disables WASAPI's automatic resampling and forces the use of miniaudio's resampler. Defaults to false. wasapi.noDefaultQualitySRC WASAPI only. Only used when `wasapi.noAutoConvertSRC` is set to false. When set to true, disables the use of `AUDCLNT_STREAMFLAGS_SRC_DEFAULT_QUALITY`. You should usually leave this set to false, which is the default. wasapi.noAutoStreamRouting WASAPI only. When set to true, disables automatic stream routing on the WASAPI backend. Defaults to false. wasapi.noHardwareOffloading WASAPI only. When set to true, disables the use of WASAPI's hardware offloading feature. Defaults to false. alsa.noMMap ALSA only. When set to true, disables MMap mode. Defaults to false. alsa.noAutoFormat ALSA only. When set to true, disables ALSA's automatic format conversion by including the SND_PCM_NO_AUTO_FORMAT flag. Defaults to false. alsa.noAutoChannels ALSA only. When set to true, disables ALSA's automatic channel conversion by including the SND_PCM_NO_AUTO_CHANNELS flag. Defaults to false. alsa.noAutoResample ALSA only. When set to true, disables ALSA's automatic resampling by including the SND_PCM_NO_AUTO_RESAMPLE flag. Defaults to false. pulse.pStreamNamePlayback PulseAudio only. Sets the stream name for playback. pulse.pStreamNameCapture PulseAudio only. Sets the stream name for capture. coreaudio.allowNominalSampleRateChange Core Audio only. Desktop only. When enabled, allows the sample rate of the device to be changed at the operating system level. This is disabled by default in order to prevent intrusive changes to the user's system. This is useful if you want to use a sample rate that is known to be natively supported by the hardware thereby avoiding the cost of resampling. When set to true, miniaudio will find the closest match between the sample rate requested in the device config and the sample rates natively supported by the hardware. When set to false, the sample rate currently set by the operating system will always be used. opensl.streamType OpenSL only. Explicitly sets the stream type. If left unset (`ma_opensl_stream_type_default`), the stream type will be left unset. Think of this as the type of audio you're playing. opensl.recordingPreset OpenSL only. Explicitly sets the type of recording your program will be doing. When left unset, the recording preset will be left unchanged. aaudio.usage AAudio only. Explicitly sets the nature of the audio the program will be consuming. When left unset, the usage will be left unchanged. aaudio.contentType AAudio only. Sets the content type. When left unset, the content type will be left unchanged. aaudio.inputPreset AAudio only. Explicitly sets the type of recording your program will be doing. When left unset, the input preset will be left unchanged. aaudio.noAutoStartAfterReroute AAudio only. Controls whether or not the device should be automatically restarted after a stream reroute. When set to false (default) the device will be restarted automatically; otherwise the device will be stopped. Once initialized, the device's config is immutable. If you need to change the config you will need to initialize a new device. After initializing the device it will be in a stopped state. To start it, use `ma_device_start()`. If both `periodSizeInFrames` and `periodSizeInMilliseconds` are set to zero, it will default to `MA_DEFAULT_PERIOD_SIZE_IN_MILLISECONDS_LOW_LATENCY` or `MA_DEFAULT_PERIOD_SIZE_IN_MILLISECONDS_CONSERVATIVE`, depending on whether or not `performanceProfile` is set to `ma_performance_profile_low_latency` or `ma_performance_profile_conservative`. If you request exclusive mode and the backend does not support it an error will be returned. For robustness, you may want to first try initializing the device in exclusive mode, and then fall back to shared mode if required. Alternatively you can just request shared mode (the default if you leave it unset in the config) which is the most reliable option. Some backends do not have a practical way of choosing whether or not the device should be exclusive or not (ALSA, for example) in which case it just acts as a hint. Unless you have special requirements you should try avoiding exclusive mode as it's intrusive to the user. Starting with Windows 10, miniaudio will use low-latency shared mode where possible which may make exclusive mode unnecessary. When sending or receiving data to/from a device, miniaudio will internally perform a format conversion to convert between the format specified by the config and the format used internally by the backend. If you pass in 0 for the sample format, channel count, sample rate _and_ channel map, data transmission will run on an optimized pass-through fast path. You can retrieve the format, channel count and sample rate by inspecting the `playback/capture.format`, `playback/capture.channels` and `sampleRate` members of the device object. When compiling for UWP you must ensure you call this function on the main UI thread because the operating system may need to present the user with a message asking for permissions. Please refer to the official documentation for ActivateAudioInterfaceAsync() for more information. ALSA Specific: When initializing the default device, requesting shared mode will try using the "dmix" device for playback and the "dsnoop" device for capture. If these fail it will try falling back to the "hw" device. Example 1 - Simple Initialization --------------------------------- This example shows how to initialize a simple playback device using a standard configuration. If you are just needing to do simple playback from the default playback device this is usually all you need. ```c ma_device_config config = ma_device_config_init(ma_device_type_playback); config.playback.format = ma_format_f32; config.playback.channels = 2; config.sampleRate = 48000; config.dataCallback = ma_data_callback; config.pMyUserData = pMyUserData; ma_device device; ma_result result = ma_device_init(NULL, &config, &device); if (result != MA_SUCCESS) { // Error } ``` Example 2 - Advanced Initialization ----------------------------------- This example shows how you might do some more advanced initialization. In this hypothetical example we want to control the latency by setting the buffer size and period count. We also want to allow the user to be able to choose which device to output from which means we need a context so we can perform device enumeration. ```c ma_context context; ma_result result = ma_context_init(NULL, 0, NULL, &context); if (result != MA_SUCCESS) { // Error } ma_device_info* pPlaybackDeviceInfos; ma_uint32 playbackDeviceCount; result = ma_context_get_devices(&context, &pPlaybackDeviceInfos, &playbackDeviceCount, NULL, NULL); if (result != MA_SUCCESS) { // Error } // ... choose a device from pPlaybackDeviceInfos ... ma_device_config config = ma_device_config_init(ma_device_type_playback); config.playback.pDeviceID = pMyChosenDeviceID; // <-- Get this from the `id` member of one of the `ma_device_info` objects returned by ma_context_get_devices(). config.playback.format = ma_format_f32; config.playback.channels = 2; config.sampleRate = 48000; config.dataCallback = ma_data_callback; config.pUserData = pMyUserData; config.periodSizeInMilliseconds = 10; config.periods = 3; ma_device device; result = ma_device_init(&context, &config, &device); if (result != MA_SUCCESS) { // Error } ``` See Also -------- ma_device_config_init() ma_device_uninit() ma_device_start() ma_context_init() ma_context_get_devices() ma_context_enumerate_devices()
device_init_ex ¶
device_init_ex :: proc "c" (backends: [^]backend, backendCount: u32, pContextConfig: ^context_config, pConfig: ^device_config, pDevice: ^device) -> result ---
Initializes a device without a context, with extra parameters for controlling the configuration of the internal self-managed context.
This is the same as ma_device_init()
, only instead of a context being passed in, the parameters from ma_context_init()
are passed in instead. This function
allows you to configure the internally created context.
Parameters ---------- backends (in, optional)
A list of backends to try initializing, in priority order. Can be NULL, in which case it uses default priority order.
backendCount (in, optional)
The number of items in `backend`. Ignored if `backend` is NULL.
pContextConfig (in, optional)
The context configuration.
pConfig (in)
A pointer to the device configuration. Cannot be null. See remarks for details.
pDevice (out)
A pointer to the device object being initialized.
Return Value ------------ MA_SUCCESS if successful; any other error code otherwise.
Thread Safety
-------------
Unsafe. It is not safe to call this function simultaneously for different devices because some backends depend on and mutate global state. The same applies to
calling this at the same time as ma_device_uninit()
.
Callback Safety --------------- Unsafe. It is not safe to call this inside any callback.
Remarks ------- You only need to use this function if you want to configure the context differently to it's defaults. You should never use this function if you want to manage your own context.
See the documentation for ma_context_init()
for information on the different context configuration options.
See Also -------- ma_device_init() ma_device_uninit() ma_device_config_init() ma_context_init()
device_is_started ¶
Determines whether or not the device is started.
Parameters ---------- pDevice (in)
A pointer to the device whose start state is being retrieved.
Return Value ------------ True if the device is started, false otherwise.
Thread Safety
-------------
Safe. If another thread calls ma_device_start()
or ma_device_stop()
at this same time as this function is called, there's a very small chance the return
value will be out of sync.
Callback Safety --------------- Safe. This is implemented as a simple accessor.
See Also -------- ma_device_start() ma_device_stop()
device_job_thread_config_init ¶
device_job_thread_config_init :: proc "c" () -> device_job_thread_config ---
device_job_thread_init ¶
device_job_thread_init :: proc "c" (pConfig: ^device_job_thread_config, pAllocationCallbacks: ^allocation_callbacks, pJobThread: ^device_job_thread) -> result ---
device_job_thread_next ¶
device_job_thread_next :: proc "c" (pJobThread: ^device_job_thread, pJob: ^job) -> result ---
device_job_thread_post ¶
device_job_thread_post :: proc "c" (pJobThread: ^device_job_thread, pJob: ^job) -> result ---
device_job_thread_uninit ¶
device_job_thread_uninit :: proc "c" (pJobThread: ^device_job_thread, pAllocationCallbacks: ^allocation_callbacks) ---
device_post_init ¶
device_post_init :: proc "c" (pDevice: ^device, deviceType: device_type, pPlaybackDescriptor, pCaptureDescriptor: ^device_descriptor) -> result ---
Performs post backend initialization routines for setting up internal data conversion.
This should be called whenever the backend is initialized. The only time this should be called from outside of miniaudio is if you're implementing a custom backend, and you would only do it if you are reinitializing the backend due to rerouting or reinitializing for some reason.
Parameters ---------- pDevice [in]
A pointer to the device.
deviceType [in]
The type of the device that was just reinitialized.
pPlaybackDescriptor [in]
The descriptor of the playback device containing the internal data format and buffer sizes.
pPlaybackDescriptor [in]
The descriptor of the capture device containing the internal data format and buffer sizes.
Return Value ------------ MA_SUCCESS if successful; any other error otherwise.
Thread Safety ------------- Unsafe. This will be reinitializing internal data converters which may be in use by another thread.
Callback Safety --------------- Unsafe. This will be reinitializing internal data converters which may be in use by the callback.
Remarks ------- For a duplex device, you can call this for only one side of the system. This is why the deviceType is specified as a parameter rather than deriving it from the device.
You do not need to call this manually unless you are doing a custom backend, in which case you need only do it if you're manually performing rerouting or reinitialization.
device_set_master_volume ¶
Sets the master volume factor for the device.
The volume factor must be between 0 (silence) and 1 (full volume). Use ma_device_set_master_volume_db()
to use decibel notation, where 0 is full volume and
values less than 0 decreases the volume.
Parameters ---------- pDevice (in)
A pointer to the device whose volume is being set.
volume (in)
The new volume factor. Must be >= 0.
Return Value ------------ MA_SUCCESS if the volume was set successfully. MA_INVALID_ARGS if pDevice is NULL. MA_INVALID_ARGS if volume is negative.
Thread Safety ------------- Safe. This just sets a local member of the device object.
Callback Safety --------------- Safe. If you set the volume in the data callback, that data written to the output buffer will have the new volume applied.
Remarks ------- This applies the volume factor across all channels.
This does not change the operating system's volume. It only affects the volume for the given ma_device
object's audio stream.
See Also -------- ma_device_get_master_volume() ma_device_set_master_volume_db() ma_device_get_master_volume_db()
device_set_master_volume_db ¶
Sets the master volume for the device as gain in decibels.
A gain of 0 is full volume, whereas a gain of < 0 will decrease the volume.
Parameters ---------- pDevice (in)
A pointer to the device whose gain is being set.
gainDB (in)
The new volume as gain in decibels. Must be less than or equal to 0, where 0 is full volume and anything less than 0 decreases the volume.
Return Value ------------ MA_SUCCESS if the volume was set successfully. MA_INVALID_ARGS if pDevice is NULL. MA_INVALID_ARGS if the gain is > 0.
Thread Safety ------------- Safe. This just sets a local member of the device object.
Callback Safety --------------- Safe. If you set the volume in the data callback, that data written to the output buffer will have the new volume applied.
Remarks ------- This applies the gain across all channels.
This does not change the operating system's volume. It only affects the volume for the given ma_device
object's audio stream.
See Also -------- ma_device_get_master_volume_gain_db() ma_device_set_master_volume() ma_device_get_master_volume()
device_start ¶
Starts the device. For playback devices this begins playback. For capture devices it begins recording.
Use ma_device_stop()
to stop the device.
Parameters ---------- pDevice (in)
A pointer to the device to start.
Return Value ------------ MA_SUCCESS if successful; any other error code otherwise.
Thread Safety ------------- Safe. It's safe to call this from any thread with the exception of the callback thread.
Callback Safety --------------- Unsafe. It is not safe to call this inside any callback.
Remarks ------- For a playback device, this will retrieve an initial chunk of audio data from the client before returning. The reason for this is to ensure there is valid audio data in the buffer, which needs to be done before the device begins playback.
This API waits until the backend device has been started for real by the worker thread. It also waits on a mutex for thread-safety.
Do not call this in any callback.
See Also -------- ma_device_stop()
device_stop ¶
Stops the device. For playback devices this stops playback. For capture devices it stops recording.
Use ma_device_start()
to start the device again.
Parameters ---------- pDevice (in)
A pointer to the device to stop.
Return Value ------------ MA_SUCCESS if successful; any other error code otherwise.
Thread Safety ------------- Safe. It's safe to call this from any thread with the exception of the callback thread.
Callback Safety --------------- Unsafe. It is not safe to call this inside any callback. Doing this will result in a deadlock.
Remarks ------- This API needs to wait on the worker thread to stop the backend device properly before returning. It also waits on a mutex for thread-safety. In addition, some backends need to wait for the device to finish playback/recording of the current fragment which can take some time (usually proportionate to the buffer size that was specified at initialization time).
Backends are required to either pause the stream in-place or drain the buffer if pausing is not possible. The reason for this is that stopping the device and the resuming it with ma_device_start() (which you might do when your program loses focus) may result in a situation where those samples are never output to the speakers or received from the microphone which can in turn result in de-syncs.
Do not call this in any callback.
See Also -------- ma_device_start()
device_uninit ¶
device_uninit :: proc "c" (pDevice: ^device) ---
Uninitializes a device.
This will explicitly stop the device. You do not need to call ma_device_stop()
beforehand, but it's harmless if you do.
Parameters ---------- pDevice (in)
A pointer to the device to stop.
Return Value ------------ Nothing
Thread Safety ------------- Unsafe. As soon as this API is called the device should be considered undefined.
Callback Safety --------------- Unsafe. It is not safe to call this inside any callback. Doing this will result in a deadlock.
See Also -------- ma_device_init() ma_device_stop()
encoder_config_init ¶
encoder_config_init :: proc "c" (encodingFormat: encoding_format, format: format, channels: u32, sampleRate: u32) -> encoder_config ---
encoder_init ¶
encoder_init :: proc "c" (onWrite: encoder_write_proc, onSeek: encoder_seek_proc, pUserData: rawptr, pConfig: ^encoder_config, pEncoder: ^encoder) -> result ---
encoder_init_file ¶
encoder_init_file :: proc "c" (pFilePath: cstring, pConfig: ^encoder_config, pEncoder: ^encoder) -> result ---
encoder_init_file_w ¶
encoder_init_file_w :: proc "c" (pFilePath: [^]u16, pConfig: ^encoder_config, pEncoder: ^encoder) -> result ---
encoder_init_vfs ¶
encoder_init_vfs :: proc "c" (pVFS: ^vfs, pFilePath: cstring, pConfig: ^encoder_config, pEncoder: ^encoder) -> result ---
encoder_init_vfs_w ¶
encoder_init_vfs_w :: proc "c" (pVFS: ^vfs, pFilePath: [^]u16, pConfig: ^encoder_config, pEncoder: ^encoder) -> result ---
encoder_uninit ¶
encoder_uninit :: proc "c" (pEncoder: ^encoder) ---
engine_config_init ¶
engine_config_init :: proc "c" () -> engine_config ---
engine_get_node_graph ¶
engine_get_node_graph :: proc "c" (pEngine: ^engine) -> ^node_graph ---
engine_get_resource_manager ¶
engine_get_resource_manager :: proc "c" (pEngine: ^engine) -> ^resource_manager ---
engine_init ¶
engine_init :: proc "c" (pConfig: ^engine_config, pEngine: ^engine) -> result ---
engine_node_config_init ¶
engine_node_config_init :: proc "c" (pEngine: ^engine, type: engine_node_type, flags: u32) -> engine_node_config ---
engine_node_get_heap_size ¶
engine_node_get_heap_size :: proc "c" (pConfig: ^engine_node_config, pHeapSizeInBytes: ^uint) -> result ---
engine_node_init ¶
engine_node_init :: proc "c" (pConfig: ^engine_node_config, pAllocationCallbacks: ^allocation_callbacks, pEngineNode: ^engine_node) -> result ---
engine_node_init_preallocated ¶
engine_node_init_preallocated :: proc "c" (pConfig: ^engine_node_config, pHeap: rawptr, pEngineNode: ^engine_node) -> result ---
engine_node_uninit ¶
engine_node_uninit :: proc "c" (pEngineNode: ^engine_node, pAllocationCallbacks: ^allocation_callbacks) ---
engine_play_sound ¶
engine_play_sound :: proc "c" (pEngine: ^engine, pFilePath: cstring, pGroup: ^sound_group) -> result ---
Fire and forget.
engine_uninit ¶
engine_uninit :: proc "c" (pEngine: ^engine) ---
event_init ¶
Initializes an auto-reset event.
event_signal ¶
Signals the specified auto-reset event.
event_wait ¶
Waits for the specified auto-reset event to become signalled.
fader_config_init ¶
fader_config_init :: proc "c" (format: format, channels, sampleRate: u32) -> fader_config ---
fader_init ¶
fader_init :: proc "c" (pConfig: ^fader_config, pFader: ^fader) -> result ---
fence_uninit ¶
fence_uninit :: proc "c" (pFence: ^fence) ---
fence_wait ¶
Wait for counter to reach 0.
gainer_config_init ¶
gainer_config_init :: proc "c" (channels, smoothTimeInFrames: u32) -> gainer_config ---
gainer_get_heap_size ¶
gainer_get_heap_size :: proc "c" (pConfig: ^gainer_config, pHeapSizeInBytes: ^uint) -> result ---
gainer_init ¶
gainer_init :: proc "c" (pConfig: ^gainer_config, pAllocationCallbacks: ^allocation_callbacks, pGainer: ^gainer) -> result ---
gainer_init_preallocated ¶
gainer_init_preallocated :: proc "c" (pConfig: ^gainer_config, pHeap: rawptr, pGainer: ^gainer) -> result ---
gainer_uninit ¶
gainer_uninit :: proc "c" (pGainer: ^gainer, pAllocationCallbacks: ^allocation_callbacks) ---
get_backend_from_name ¶
Retrieves the backend enum from the given name.
get_backend_name ¶
Retrieves a friendly name for a backend.
get_bytes_per_sample ¶
Retrieves the size of a sample in bytes for the given format.
This API is efficient and is implemented using a lookup table.
Thread Safety: SAFE This API is pure.
get_enabled_backends ¶
get_enabled_backends :: proc "c" (pBackends: [^]backend, backendCap: uint, pBackendCount: ^uint) -> result ---
Retrieves compile-time enabled backends.
Parameters ---------- pBackends (out, optional)
A pointer to the buffer that will receive the enabled backends. Set to NULL to retrieve the backend count. Setting the capacity of the buffer to `MA_BUFFER_COUNT` will guarantee it's large enough for all backends.
backendCap (in)
The capacity of the `pBackends` buffer.
pBackendCount (out)
A pointer to the variable that will receive the enabled backend count.
Return Value
------------
MA_SUCCESS if successful.
MA_INVALID_ARGS if pBackendCount
is NULL.
MA_NO_SPACE if the capacity of pBackends
is not large enough.
If MA_NO_SPACE
is returned, the pBackends
buffer will be filled with *pBackendCount
values.
Thread Safety ------------- Safe.
Callback Safety --------------- Safe.
Remarks
-------
If you want to retrieve the number of backends so you can determine the capacity of pBackends
buffer, you can call
this function with pBackends
set to NULL.
This will also enumerate the null backend. If you don't want to include this you need to check for ma_backend_null
when you enumerate over the returned backends and handle it appropriately. Alternatively, you can disable it at
compile time with MA_NO_NULL
.
The returned backends are determined based on compile time settings, not the platform it's currently running on. For example, PulseAudio will be returned if it was enabled at compile time, even when the user doesn't actually have PulseAudio installed.
Example 1
---------
The example below retrieves the enabled backend count using a fixed sized buffer allocated on the stack. The buffer is
given a capacity of MA_BACKEND_COUNT
which will guarantee it'll be large enough to store all available backends.
Since MA_BACKEND_COUNT
is always a relatively small value, this should be suitable for most scenarios.
`
ma_backend enabledBackends[MA_BACKEND_COUNT];
size_t enabledBackendCount;
result = ma_get_enabled_backends(enabledBackends, MA_BACKEND_COUNT, &enabledBackendCount); if (result != MA_SUCCESS) {
// Failed to retrieve enabled backends. Should never happen in this example since all inputs are valid.
}
`
See Also -------- ma_is_backend_enabled()
get_format_name ¶
Retrieves a friendly name for a format.
hishelf2_config_init ¶
hishelf2_config_init :: proc "c" ( format: format, channels: u32, sampleRate: u32, gainDB, shelfSlope, frequency: f64, ) -> hishelf_config ---
hishelf2_get_heap_size ¶
hishelf2_get_heap_size :: proc "c" (pConfig: ^hishelf_config, pHeapSizeInBytes: ^uint) -> result ---
hishelf2_init ¶
hishelf2_init :: proc "c" (pConfig: ^hishelf_config, pAllocationCallbacks: ^allocation_callbacks, pFilter: ^hishelf2) -> result ---
hishelf2_init_preallocated ¶
hishelf2_init_preallocated :: proc "c" (pConfig: ^hishelf_config, pHeap: rawptr, pFilter: ^hishelf2) -> result ---
hishelf2_reinit ¶
hishelf2_reinit :: proc "c" (pConfig: ^hishelf_config, pFilter: ^hishelf2) -> result ---
hishelf2_uninit ¶
hishelf2_uninit :: proc "c" (pFilter: ^hishelf2, pAllocationCallbacks: ^allocation_callbacks) ---
hishelf_node_config_init ¶
hishelf_node_config_init :: proc "c" (channels, sampleRate: u32, gainDB, q, frequency: f64) -> hishelf_node_config ---
hishelf_node_init ¶
hishelf_node_init :: proc "c" (pNodeGraph: ^node_graph, pConfig: ^hishelf_node_config, pAllocationCallbacks: ^allocation_callbacks, pNode: ^hishelf_node) -> result ---
hishelf_node_reinit ¶
hishelf_node_reinit :: proc "c" (pConfig: ^hishelf_config, pNode: ^hishelf_node) -> result ---
hishelf_node_uninit ¶
hishelf_node_uninit :: proc "c" (pNode: ^hishelf_node, pAllocationCallbacks: ^allocation_callbacks) ---
hpf1_config_init ¶
hpf1_config_init :: proc "c" (format: format, channels: u32, sampleRate: u32, cutoffFrequency: f64) -> hpf1_config ---
hpf1_get_heap_size ¶
hpf1_get_heap_size :: proc "c" (pConfig: ^hpf1_config, pHeapSizeInBytes: ^uint) -> result ---
hpf1_init ¶
hpf1_init :: proc "c" (pConfig: ^hpf1_config, pAllocationCallbacks: ^allocation_callbacks, pHPF: ^hpf1) -> result ---
hpf1_init_preallocated ¶
hpf1_init_preallocated :: proc "c" (pConfig: ^hpf1_config, pHeap: rawptr, pLPF: ^hpf1) -> result ---
hpf1_reinit ¶
hpf1_reinit :: proc "c" (pConfig: ^hpf1_config, pHPF: ^hpf1) -> result ---
hpf1_uninit ¶
hpf1_uninit :: proc "c" (pHPF: ^hpf1, pAllocationCallbacks: ^allocation_callbacks) ---
hpf2_config_init ¶
hpf2_config_init :: proc "c" (format: format, channels: u32, sampleRate: u32, cutoffFrequency, q: f64) -> hpf1_config ---
hpf2_get_heap_size ¶
hpf2_get_heap_size :: proc "c" (pConfig: ^hpf1_config, pHeapSizeInBytes: ^uint) -> result ---
hpf2_init ¶
hpf2_init :: proc "c" (pConfig: ^hpf1_config, pAllocationCallbacks: ^allocation_callbacks, pHPF: ^hpf2) -> result ---
hpf2_init_preallocated ¶
hpf2_init_preallocated :: proc "c" (pConfig: ^hpf1_config, pHeap: rawptr, pHPF: ^hpf2) -> result ---
hpf2_reinit ¶
hpf2_reinit :: proc "c" (pConfig: ^hpf1_config, pHPF: ^hpf2) -> result ---
hpf2_uninit ¶
hpf2_uninit :: proc "c" (pHPF: ^hpf2, pAllocationCallbacks: ^allocation_callbacks) ---
hpf_get_heap_size ¶
hpf_get_heap_size :: proc "c" (pConfig: ^hpf_config, pHeapSizeInBytes: ^uint) -> result ---
hpf_init ¶
hpf_init :: proc "c" (pConfig: ^hpf_config, pAllocationCallbacks: ^allocation_callbacks, pHPF: ^hpf) -> result ---
hpf_init_preallocated ¶
hpf_init_preallocated :: proc "c" (pConfig: ^hpf_config, pHeap: rawptr, pLPF: ^hpf) -> result ---
hpf_node_config_init ¶
hpf_node_config_init :: proc "c" (channels, sampleRate: u32, cutoffFrequency: f64, order: u32) -> hpf_node_config ---
hpf_node_init ¶
hpf_node_init :: proc "c" (pNodeGraph: ^node_graph, pConfig: ^hpf_node_config, pAllocationCallbacks: ^allocation_callbacks, pNode: ^hpf_node) -> result ---
hpf_node_reinit ¶
hpf_node_reinit :: proc "c" (pConfig: ^hpf_config, pNode: ^hpf_node) -> result ---
hpf_node_uninit ¶
hpf_node_uninit :: proc "c" (pNode: ^hpf_node, pAllocationCallbacks: ^allocation_callbacks) ---
hpf_reinit ¶
hpf_reinit :: proc "c" (pConfig: ^hpf_config, pHPF: ^hpf) -> result ---
hpf_uninit ¶
hpf_uninit :: proc "c" (pHPF: ^hpf, pAllocationCallbacks: ^allocation_callbacks) ---
interleave_pcm_frames ¶
interleave_pcm_frames :: proc "c" (format: format, channels: u32, frameCount: u64, ppDeinterleavedPCMFrames: ^rawptr, pInterleavedPCMFrames: rawptr) ---
Interleaves a group of deinterleaved buffers.
is_backend_enabled ¶
Determines whether or not the given backend is available by the compilation environment.
is_loopback_supported ¶
Determines whether or not loopback mode is support by a backend.
job_queue_config_init ¶
job_queue_config_init :: proc "c" (flags, capacity: u32) -> job_queue_config ---
job_queue_get_heap_size ¶
job_queue_get_heap_size :: proc "c" (pConfig: ^job_queue_config, pHeapSizeInBytes: ^uint) -> result ---
job_queue_init ¶
job_queue_init :: proc "c" (pConfig: ^job_queue_config, pAllocationCallbacks: ^allocation_callbacks, pQueue: ^job_queue) -> result ---
job_queue_init_preallocated ¶
job_queue_init_preallocated :: proc "c" (pConfig: ^job_queue_config, pHeap: rawptr, pQueue: ^job_queue) -> result ---
job_queue_next ¶
Returns MA_CANCELLED if the next job is a quit job.
job_queue_uninit ¶
job_queue_uninit :: proc "c" (pQueue: ^job_queue, pAllocationCallbacks: ^allocation_callbacks) ---
linear_resampler_config_init ¶
linear_resampler_config_init :: proc "c" (format: format, channels: u32, sampleRateIn, sampleRateOut: u32) -> linear_resampler_config ---
linear_resampler_get_expected_output_frame_count ¶
linear_resampler_get_expected_output_frame_count :: proc "c" (pResampler: ^linear_resampler, inputFrameCount: u64, pOutputFrameCount: ^u64) -> result ---
linear_resampler_get_heap_size ¶
linear_resampler_get_heap_size :: proc "c" (pConfig: ^linear_resampler_config, pHeapSizeInBytes: ^uint) -> result ---
linear_resampler_get_input_latency ¶
linear_resampler_get_input_latency :: proc "c" (pResampler: ^linear_resampler) -> u64 ---
linear_resampler_get_output_latency ¶
linear_resampler_get_output_latency :: proc "c" (pResampler: ^linear_resampler) -> u64 ---
linear_resampler_get_required_input_frame_count ¶
linear_resampler_get_required_input_frame_count :: proc "c" (pResampler: ^linear_resampler, outputFrameCount: u64, pInputFrameCount: ^u64) -> result ---
linear_resampler_init ¶
linear_resampler_init :: proc "c" (pConfig: ^linear_resampler_config, pAllocationCallbacks: ^allocation_callbacks, pResampler: ^linear_resampler) -> result ---
linear_resampler_init_preallocated ¶
linear_resampler_init_preallocated :: proc "c" (pConfig: ^linear_resampler_config, pHeap: rawptr, pResampler: ^linear_resampler) -> result ---
linear_resampler_reset ¶
linear_resampler_reset :: proc "c" (pResampler: ^linear_resampler) -> result ---
linear_resampler_set_rate ¶
linear_resampler_set_rate :: proc "c" (pResampler: ^linear_resampler, sampleRateIn, sampleRateOut: u32) -> result ---
linear_resampler_set_rate_ratio ¶
linear_resampler_set_rate_ratio :: proc "c" (pResampler: ^linear_resampler, ratioInOut: f32) -> result ---
linear_resampler_uninit ¶
linear_resampler_uninit :: proc "c" (pResampler: ^linear_resampler, pAllocationCallbacks: ^allocation_callbacks) ---
log_callback_init ¶
log_callback_init :: proc "c" (onLog: log_callback_proc, pUserData: rawptr) -> log_callback ---
log_init ¶
log_init :: proc "c" (pAllocationCallbacks: ^allocation_callbacks, pLog: ^log) -> result ---
log_level_to_string ¶
Converts a log level to a string.
log_register_callback ¶
log_register_callback :: proc "c" (pLog: ^log, callback: log_callback) -> result ---
log_uninit ¶
log_uninit :: proc "c" (pLog: ^log) ---
log_unregister_callback ¶
log_unregister_callback :: proc "c" (pLog: ^log, callback: log_callback) -> result ---
loshelf2_config_init ¶
loshelf2_config_init :: proc "c" ( format: format, channels: u32, sampleRate: u32, gainDB, shelfSlope, frequency: f64, ) -> loshelf_config ---
loshelf2_get_heap_size ¶
loshelf2_get_heap_size :: proc "c" (pConfig: ^loshelf_config, pHeapSizeInBytes: ^uint) -> result ---
loshelf2_init ¶
loshelf2_init :: proc "c" (pConfig: ^loshelf_config, pAllocationCallbacks: ^allocation_callbacks, pFilter: ^loshelf2) -> result ---
loshelf2_init_preallocated ¶
loshelf2_init_preallocated :: proc "c" (pConfig: ^loshelf_config, pHeap: rawptr, pFilter: ^loshelf2) -> result ---
loshelf2_reinit ¶
loshelf2_reinit :: proc "c" (pConfig: ^loshelf_config, pFilter: ^loshelf2) -> result ---
loshelf2_uninit ¶
loshelf2_uninit :: proc "c" (pFilter: ^loshelf2, pAllocationCallbacks: ^allocation_callbacks) ---
loshelf_node_config_init ¶
loshelf_node_config_init :: proc "c" (channels, sampleRate: u32, gainDB, q, frequency: f64) -> loshelf_node_config ---
loshelf_node_init ¶
loshelf_node_init :: proc "c" (pNodeGraph: ^node_graph, pConfig: ^loshelf_node_config, pAllocationCallbacks: ^allocation_callbacks, pNode: ^loshelf_node) -> result ---
loshelf_node_reinit ¶
loshelf_node_reinit :: proc "c" (pConfig: ^loshelf_config, pNode: ^loshelf_node) -> result ---
loshelf_node_uninit ¶
loshelf_node_uninit :: proc "c" (pNode: ^loshelf_node, pAllocationCallbacks: ^allocation_callbacks) ---
lpf1_config_init ¶
lpf1_config_init :: proc "c" (format: format, channels: u32, sampleRate: u32, cutoffFrequency: f64) -> lpf1_config ---
lpf1_get_heap_size ¶
lpf1_get_heap_size :: proc "c" (pConfig: ^lpf1_config, pHeapSizeInBytes: ^uint) -> result ---
lpf1_init ¶
lpf1_init :: proc "c" (pConfig: ^lpf1_config, pAllocationCallbacks: ^allocation_callbacks, pLPF: ^lpf1) -> result ---
lpf1_init_preallocated ¶
lpf1_init_preallocated :: proc "c" (pConfig: ^lpf1_config, pHeap: rawptr, pLPF: ^lpf1) -> result ---
lpf1_reinit ¶
lpf1_reinit :: proc "c" (pConfig: ^lpf1_config, pLPF: ^lpf1) -> result ---
lpf1_uninit ¶
lpf1_uninit :: proc "c" (pLPF: ^lpf1, pAllocationCallbacks: ^allocation_callbacks) ---
lpf2_config_init ¶
lpf2_config_init :: proc "c" (format: format, channels: u32, sampleRate: u32, cutoffFrequency, q: f64) -> lpf1_config ---
lpf2_get_heap_size ¶
lpf2_get_heap_size :: proc "c" (pConfig: ^lpf1_config, pHeapSizeInBytes: ^uint) -> result ---
lpf2_init ¶
lpf2_init :: proc "c" (pConfig: ^lpf1_config, pAllocationCallbacks: ^allocation_callbacks, pLPF: ^lpf2) -> result ---
lpf2_init_preallocated ¶
lpf2_init_preallocated :: proc "c" (pConfig: ^lpf1_config, pHeap: rawptr, pHPF: ^lpf2) -> result ---
lpf2_reinit ¶
lpf2_reinit :: proc "c" (pConfig: ^lpf1_config, pLPF: ^lpf2) -> result ---
lpf2_uninit ¶
lpf2_uninit :: proc "c" (pLPF: ^lpf2, pAllocationCallbacks: ^allocation_callbacks) ---
lpf_get_heap_size ¶
lpf_get_heap_size :: proc "c" (pConfig: ^lpf_config, pHeapSizeInBytes: ^uint) -> result ---
lpf_init ¶
lpf_init :: proc "c" (pConfig: ^lpf_config, pAllocationCallbacks: ^allocation_callbacks, pLPF: ^lpf) -> result ---
lpf_init_preallocated ¶
lpf_init_preallocated :: proc "c" (pConfig: ^lpf_config, pHeap: rawptr, pLPF: ^lpf) -> result ---
lpf_node_config_init ¶
lpf_node_config_init :: proc "c" (channels, sampleRate: u32, cutoffFrequency: f64, order: u32) -> lpf_node_config ---
lpf_node_init ¶
lpf_node_init :: proc "c" (pNodeGraph: ^node_graph, pConfig: ^lpf_node_config, pAllocationCallbacks: ^allocation_callbacks, pNode: ^lpf_node) -> result ---
lpf_node_reinit ¶
lpf_node_reinit :: proc "c" (pConfig: ^lpf_config, pNode: ^lpf_node) -> result ---
lpf_node_uninit ¶
lpf_node_uninit :: proc "c" (pNode: ^lpf_node, pAllocationCallbacks: ^allocation_callbacks) ---
lpf_reinit ¶
lpf_reinit :: proc "c" (pConfig: ^lpf_config, pLPF: ^lpf) -> result ---
lpf_uninit ¶
lpf_uninit :: proc "c" (pLPF: ^lpf, pAllocationCallbacks: ^allocation_callbacks) ---
ma_mix_pcm_frames_f32 ¶
ma_mix_pcm_frames_f32 :: proc "c" (pDst: ^f32, pSrc: ^f32, frameCount: u64, channels: u32, volume: f32) -> result ---
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.
malloc ¶
malloc :: proc "c" (sz: uint, pAllocationCallbacks: ^allocation_callbacks) -> rawptr ---
malloc()
mutex_init ¶
Creates a mutex.
A mutex must be created from a valid context. A mutex is initially unlocked.
node_config_init ¶
node_config_init :: proc "c" () -> node_config ---
node_get_heap_size ¶
node_get_heap_size :: proc "c" (pNodeGraph: ^node_graph, pConfig: ^node_config, pHeapSizeInBytes: ^uint) -> result ---
node_get_node_graph ¶
node_get_node_graph :: proc "c" (pNode: ^node) -> ^node_graph ---
node_get_state ¶
node_get_state :: proc "c" (pNode: ^node) -> node_state ---
node_get_state_by_time ¶
node_get_state_by_time :: proc "c" (pNode: ^node, globalTime: u64) -> node_state ---
node_get_state_by_time_range ¶
node_get_state_by_time_range :: proc "c" (pNode: ^node, globalTimeBeg: u64, globalTimeEnd: u64) -> node_state ---
node_get_state_time ¶
node_get_state_time :: proc "c" (pNode: ^node, state: node_state) -> u64 ---
node_graph_config_init ¶
node_graph_config_init :: proc "c" (channels: u32) -> node_graph_config ---
node_graph_get_channels ¶
node_graph_get_channels :: proc "c" (pNodeGraph: ^node_graph) -> u32 ---
node_graph_get_endpoint ¶
node_graph_get_endpoint :: proc "c" (pNodeGraph: ^node_graph) -> ^node ---
node_graph_get_time ¶
node_graph_get_time :: proc "c" (pNodeGraph: ^node_graph) -> u64 ---
node_graph_init ¶
node_graph_init :: proc "c" (pConfig: ^node_graph_config, pAllocationCallbacks: ^allocation_callbacks, pNodeGraph: ^node_graph) -> result ---
node_graph_read_pcm_frames ¶
node_graph_read_pcm_frames :: proc "c" (pNodeGraph: ^node_graph, pFramesOut: rawptr, frameCount: u64, pFramesRead: ^u64) -> result ---
node_graph_set_time ¶
node_graph_set_time :: proc "c" (pNodeGraph: ^node_graph, globalTime: u64) -> result ---
node_graph_uninit ¶
node_graph_uninit :: proc "c" (pNodeGraph: ^node_graph, pAllocationCallbacks: ^allocation_callbacks) ---
node_init ¶
node_init :: proc "c" (pNodeGraph: ^node_graph, pConfig: ^node_config, pAllocationCallbacks: ^allocation_callbacks, pNode: ^node) -> result ---
node_init_preallocated ¶
node_init_preallocated :: proc "c" (pNodeGraph: ^node_graph, pConfig: ^node_config, pHeap: rawptr, pNode: ^node) -> result ---
node_set_state ¶
node_set_state :: proc "c" (pNode: ^node, state: node_state) -> result ---
node_set_state_time ¶
node_set_state_time :: proc "c" (pNode: ^node, state: node_state, globalTime: u64) -> result ---
node_uninit ¶
node_uninit :: proc "c" (pNode: ^node, pAllocationCallbacks: ^allocation_callbacks) ---
noise_config_init ¶
noise_config_init :: proc "c" (format: format, channels: u32, type: noise_type, seed: i32, amplitude: f64) -> noise_config ---
noise_get_heap_size ¶
noise_get_heap_size :: proc "c" (pConfig: ^noise_config, pHeapSizeInBytes: ^uint) -> result ---
noise_init ¶
noise_init :: proc "c" (pConfig: ^noise_config, pAllocationCallbacks: ^allocation_callbacks, pNoise: ^noise) -> result ---
noise_init_preallocated ¶
noise_init_preallocated :: proc "c" (pConfig: ^noise_config, pHeap: rawptr, pNoise: ^noise) -> result ---
noise_set_type ¶
noise_set_type :: proc "c" (pNoise: ^noise, type: noise_type) -> result ---
noise_uninit ¶
noise_uninit :: proc "c" (pNoise: ^noise, pAllocationCallbacks: ^allocation_callbacks) ---
notch2_get_heap_size ¶
notch2_get_heap_size :: proc "c" (pConfig: ^notch_config, pHeapSizeInBytes: ^uint) -> result ---
notch2_init ¶
notch2_init :: proc "c" (pConfig: ^notch_config, pAllocationCallbacks: ^allocation_callbacks, pFilter: ^notch2) -> result ---
notch2_init_preallocated ¶
notch2_init_preallocated :: proc "c" (pConfig: ^notch_config, pHeap: rawptr, pFilter: ^notch2) -> result ---
notch2_reinit ¶
notch2_reinit :: proc "c" (pConfig: ^notch_config, pFilter: ^notch2) -> result ---
notch2_uninit ¶
notch2_uninit :: proc "c" (pFilter: ^notch2, pAllocationCallbacks: ^allocation_callbacks) ---
notch_node_config_init ¶
notch_node_config_init :: proc "c" (channels, sampleRate: u32, q, frequency: f64) -> notch_node_config ---
notch_node_init ¶
notch_node_init :: proc "c" (pNodeGraph: ^node_graph, pConfig: ^notch_node_config, pAllocationCallbacks: ^allocation_callbacks, pNode: ^notch_node) -> result ---
notch_node_reinit ¶
notch_node_reinit :: proc "c" (pConfig: ^notch_config, pNode: ^notch_node) -> result ---
notch_node_uninit ¶
notch_node_uninit :: proc "c" (pNode: ^notch_node, pAllocationCallbacks: ^allocation_callbacks) ---
offset_pcm_frames_ptr ¶
offset_pcm_frames_ptr :: proc "c" (p: rawptr, offsetInFrames: u64, format: format, channels: u32) -> rawptr ---
Offsets a pointer by the specified number of PCM frames.
paged_audio_buffer_config_init ¶
paged_audio_buffer_config_init :: proc "c" (pData: ^paged_audio_buffer_data) -> paged_audio_buffer_config ---
paged_audio_buffer_data_allocate_and_append_page ¶
paged_audio_buffer_data_allocate_and_append_page :: proc "c" (pData: ^paged_audio_buffer_data, pageSizeInFrames: u32, pInitialData: rawptr, pAllocationCallbacks: ^allocation_callbacks) -> result ---
paged_audio_buffer_data_allocate_page ¶
paged_audio_buffer_data_allocate_page :: proc "c" (pData: ^paged_audio_buffer_data, pageSizeInFrames: u64, pInitialData: rawptr, pAllocationCallbacks: ^allocation_callbacks, ppPage: ^^paged_audio_buffer_page) -> result ---
paged_audio_buffer_data_append_page ¶
paged_audio_buffer_data_append_page :: proc "c" (pData: ^paged_audio_buffer_data, pPage: ^paged_audio_buffer_page) -> result ---
paged_audio_buffer_data_free_page ¶
paged_audio_buffer_data_free_page :: proc "c" (pData: ^paged_audio_buffer_data, pPage: ^paged_audio_buffer_page, pAllocationCallbacks: ^allocation_callbacks) -> result ---
paged_audio_buffer_data_get_head ¶
paged_audio_buffer_data_get_head :: proc "c" (pData: ^paged_audio_buffer_data) -> ^paged_audio_buffer_page ---
paged_audio_buffer_data_get_length_in_pcm_frames ¶
paged_audio_buffer_data_get_length_in_pcm_frames :: proc "c" (pData: ^paged_audio_buffer_data, pLength: ^u64) -> result ---
paged_audio_buffer_data_get_tail ¶
paged_audio_buffer_data_get_tail :: proc "c" (pData: ^paged_audio_buffer_data) -> ^paged_audio_buffer_page ---
paged_audio_buffer_data_init ¶
paged_audio_buffer_data_init :: proc "c" (format: format, channels: u32, pData: ^paged_audio_buffer_data) -> result ---
paged_audio_buffer_data_uninit ¶
paged_audio_buffer_data_uninit :: proc "c" (pData: ^paged_audio_buffer_data, pAllocationCallbacks: ^allocation_callbacks) ---
paged_audio_buffer_get_cursor_in_pcm_frames ¶
paged_audio_buffer_get_cursor_in_pcm_frames :: proc "c" (pPagedAudioBuffer: ^paged_audio_buffer, pCursor: ^u64) -> result ---
paged_audio_buffer_get_length_in_pcm_frames ¶
paged_audio_buffer_get_length_in_pcm_frames :: proc "c" (pPagedAudioBuffer: ^paged_audio_buffer, pLength: ^u64) -> result ---
paged_audio_buffer_init ¶
paged_audio_buffer_init :: proc "c" (pConfig: ^paged_audio_buffer_config, pPagedAudioBuffer: ^paged_audio_buffer) -> result ---
paged_audio_buffer_read_pcm_frames ¶
paged_audio_buffer_read_pcm_frames :: proc "c" (pPagedAudioBuffer: ^paged_audio_buffer, pFramesOut: rawptr, frameCount: u64, pFramesRead: ^u64) -> result ---
Returns MA_AT_END if no more pages available.
paged_audio_buffer_seek_to_pcm_frame ¶
paged_audio_buffer_seek_to_pcm_frame :: proc "c" (pPagedAudioBuffer: ^paged_audio_buffer, frameIndex: u64) -> result ---
paged_audio_buffer_uninit ¶
paged_audio_buffer_uninit :: proc "c" (pPagedAudioBuffer: ^paged_audio_buffer) ---
panner_config_init ¶
panner_config_init :: proc "c" (format: format, channels: u32) -> panner_config ---
panner_init ¶
panner_init :: proc "c" (pConfig: ^panner_config, pPanner: ^panner) -> result ---
pcm_f32_to_s16 ¶
pcm_f32_to_s16 :: proc "c" (pOut: rawptr, pIn: rawptr, count: u64, ditherMode: dither_mode) ---
pcm_f32_to_s24 ¶
pcm_f32_to_s24 :: proc "c" (pOut: rawptr, pIn: rawptr, count: u64, ditherMode: dither_mode) ---
pcm_f32_to_s32 ¶
pcm_f32_to_s32 :: proc "c" (pOut: rawptr, pIn: rawptr, count: u64, ditherMode: dither_mode) ---
pcm_f32_to_u8 ¶
pcm_f32_to_u8 :: proc "c" (pOut: rawptr, pIn: rawptr, count: u64, ditherMode: dither_mode) ---
pcm_rb_pointer_distance ¶
Return value is in frames.
pcm_rb_reset ¶
pcm_rb_reset :: proc "c" (pRB: ^pcm_rb) ---
pcm_rb_uninit ¶
pcm_rb_uninit :: proc "c" (pRB: ^pcm_rb) ---
pcm_s16_to_f32 ¶
pcm_s16_to_f32 :: proc "c" (pOut: rawptr, pIn: rawptr, count: u64, ditherMode: dither_mode) ---
pcm_s16_to_s24 ¶
pcm_s16_to_s24 :: proc "c" (pOut: rawptr, pIn: rawptr, count: u64, ditherMode: dither_mode) ---
pcm_s16_to_s32 ¶
pcm_s16_to_s32 :: proc "c" (pOut: rawptr, pIn: rawptr, count: u64, ditherMode: dither_mode) ---
pcm_s16_to_u8 ¶
pcm_s16_to_u8 :: proc "c" (pOut: rawptr, pIn: rawptr, count: u64, ditherMode: dither_mode) ---
pcm_s24_to_f32 ¶
pcm_s24_to_f32 :: proc "c" (pOut: rawptr, pIn: rawptr, count: u64, ditherMode: dither_mode) ---
pcm_s24_to_s16 ¶
pcm_s24_to_s16 :: proc "c" (pOut: rawptr, pIn: rawptr, count: u64, ditherMode: dither_mode) ---
pcm_s24_to_s32 ¶
pcm_s24_to_s32 :: proc "c" (pOut: rawptr, pIn: rawptr, count: u64, ditherMode: dither_mode) ---
pcm_s24_to_u8 ¶
pcm_s24_to_u8 :: proc "c" (pOut: rawptr, pIn: rawptr, count: u64, ditherMode: dither_mode) ---
pcm_s32_to_f32 ¶
pcm_s32_to_f32 :: proc "c" (pOut: rawptr, pIn: rawptr, count: u64, ditherMode: dither_mode) ---
pcm_s32_to_s16 ¶
pcm_s32_to_s16 :: proc "c" (pOut: rawptr, pIn: rawptr, count: u64, ditherMode: dither_mode) ---
pcm_s32_to_s24 ¶
pcm_s32_to_s24 :: proc "c" (pOut: rawptr, pIn: rawptr, count: u64, ditherMode: dither_mode) ---
pcm_s32_to_u8 ¶
pcm_s32_to_u8 :: proc "c" (pOut: rawptr, pIn: rawptr, count: u64, ditherMode: dither_mode) ---
pcm_u8_to_f32 ¶
pcm_u8_to_f32 :: proc "c" (pOut: rawptr, pIn: rawptr, count: u64, ditherMode: dither_mode) ---
pcm_u8_to_s16 ¶
pcm_u8_to_s16 :: proc "c" (pOut: rawptr, pIn: rawptr, count: u64, ditherMode: dither_mode) ---
pcm_u8_to_s24 ¶
pcm_u8_to_s24 :: proc "c" (pOut: rawptr, pIn: rawptr, count: u64, ditherMode: dither_mode) ---
pcm_u8_to_s32 ¶
pcm_u8_to_s32 :: proc "c" (pOut: rawptr, pIn: rawptr, count: u64, ditherMode: dither_mode) ---
peak2_config_init ¶
peak2_config_init :: proc "c" ( format: format, channels: u32, sampleRate: u32, gainDB, q, frequency: f64, ) -> peak_config ---
peak2_get_heap_size ¶
peak2_get_heap_size :: proc "c" (pConfig: ^peak_config, pHeapSizeInBytes: ^uint) -> result ---
peak2_init ¶
peak2_init :: proc "c" (pConfig: ^peak_config, pAllocationCallbacks: ^allocation_callbacks, pFilter: ^peak2) -> result ---
peak2_init_preallocated ¶
peak2_init_preallocated :: proc "c" (pConfig: ^peak_config, pHeap: rawptr, pFilter: ^peak2) -> result ---
peak2_reinit ¶
peak2_reinit :: proc "c" (pConfig: ^peak_config, pFilter: ^peak2) -> result ---
peak2_uninit ¶
peak2_uninit :: proc "c" (pFilter: ^peak2, pAllocationCallbacks: ^allocation_callbacks) ---
peak_node_config_init ¶
peak_node_config_init :: proc "c" (channels, sampleRate: u32, gainDB, q, frequency: f64) -> peak_node_config ---
peak_node_init ¶
peak_node_init :: proc "c" (pNodeGraph: ^node_graph, pConfig: ^peak_node_config, pAllocationCallbacks: ^allocation_callbacks, pNode: ^peak_node) -> result ---
peak_node_reinit ¶
peak_node_reinit :: proc "c" (pConfig: ^peak_config, pNode: ^peak_node) -> result ---
peak_node_uninit ¶
peak_node_uninit :: proc "c" (pNode: ^peak_node, pAllocationCallbacks: ^allocation_callbacks) ---
pulsewave_init ¶
pulsewave_init :: proc "c" (pConfig: ^pulsewave_config, pWaveForm: ^pulsewave) -> result ---
pulsewave_uninit ¶
pulsewave_uninit :: proc "c" (pWaveForm: ^pulsewave) ---
rb_init ¶
rb_init :: proc "c" (bufferSizeInBytes: uint, pOptionalPreallocatedBuffer: rawptr, pAllocationCallbacks: ^allocation_callbacks, pRB: ^rb) -> result ---
rb_init_ex ¶
rb_init_ex :: proc "c" ( subbufferSizeInBytes, subbufferCount, subbufferStrideInBytes: uint, pOptionalPreallocatedBuffer: rawptr, pAllocationCallbacks: ^allocation_callbacks, pRB: ^rb, ) -> result ---
rb_pointer_distance ¶
Returns the distance between the write pointer and the read pointer. Should never be negative for a correct program. Will return the number of bytes that can be read before the read pointer hits the write pointer.
rb_reset ¶
rb_reset :: proc "c" (pRB: ^rb) ---
rb_uninit ¶
rb_uninit :: proc "c" (pRB: ^rb) ---
realloc ¶
realloc :: proc "c" (p: rawptr, sz: uint, pAllocationCallbacks: ^allocation_callbacks) -> rawptr ---
realloc()
resampler_config_init ¶
resampler_config_init :: proc "c" (format: format, channels: u32, sampleRateIn, sampleRateOut: u32, algorithm: resample_algorithm) -> resampler_config ---
resampler_get_expected_output_frame_count ¶
resampler_get_expected_output_frame_count :: proc "c" (pResampler: ^resampler, inputFrameCount: u64, pOutputFrameCount: ^u64) -> result ---
Calculates the number of whole output frames that would be output after fully reading and consuming the specified number of input frames.
resampler_get_heap_size ¶
resampler_get_heap_size :: proc "c" (pConfig: ^resampler_config, pHeapSizeInBytes: ^uint) -> result ---
resampler_get_input_latency ¶
Retrieves the latency introduced by the resampler in input frames.
resampler_get_output_latency ¶
Retrieves the latency introduced by the resampler in output frames.
resampler_get_required_input_frame_count ¶
resampler_get_required_input_frame_count :: proc "c" (pResampler: ^resampler, outputFrameCount: u64, pInputFrameCount: ^u64) -> result ---
Calculates the number of whole input frames that would need to be read from the client in order to output the specified number of output frames.
The returned value does not include cached input frames. It only returns the number of extra frames that would need to be read from the input buffer in order to output the specified number of output frames.
resampler_init ¶
resampler_init :: proc "c" (pConfig: ^resampler_config, pAllocationCallbacks: ^allocation_callbacks, pResampler: ^resampler) -> result ---
Initializes a new resampler object from a config.
resampler_init_preallocated ¶
resampler_init_preallocated :: proc "c" (pConfig: ^resampler_config, pHeap: rawptr, pResampler: ^resampler) -> result ---
resampler_process_pcm_frames ¶
resampler_process_pcm_frames :: proc "c" (pResampler: ^resampler, pFramesIn: rawptr, pFrameCountIn: ^u64, pFramesOut: rawptr, pFrameCountOut: ^u64) -> result ---
Converts the given input data.
Both the input and output frames must be in the format specified in the config when the resampler was initialized.
On input, [pFrameCountOut] contains the number of output frames to process. On output it contains the number of output frames that were actually processed, which may be less than the requested amount which will happen if there's not enough input data. You can use ma_resampler_get_expected_output_frame_count() to know how many output frames will be processed for a given number of input frames.
On input, [pFrameCountIn] contains the number of input frames contained in [pFramesIn]. On output it contains the number of whole input frames that were actually processed. You can use ma_resampler_get_required_input_frame_count() to know how many input frames you should provide for a given number of output frames. [pFramesIn] can be NULL, in which case zeroes will be used instead.
If [pFramesOut] is NULL, a seek is performed. In this case, if [pFrameCountOut] is not NULL it will seek by the specified number of output frames. Otherwise, if [pFramesCountOut] is NULL and [pFrameCountIn] is not NULL, it will seek by the specified number of input frames. When seeking, [pFramesIn] is allowed to NULL, in which case the internal timing state will be updated, but no input will be processed. In this case, any internal filter state will be updated as if zeroes were passed in.
It is an error for [pFramesOut] to be non-NULL and [pFrameCountOut] to be NULL.
It is an error for both [pFrameCountOut] and [pFrameCountIn] to be NULL.
resampler_reset ¶
Resets the resampler's timer and clears it's internal cache.
resampler_set_rate ¶
resampler_set_rate :: proc "c" (pResampler: ^resampler, sampleRateIn, sampleRateOut: u32) -> result ---
Sets the input and output sample rate.
resampler_set_rate_ratio ¶
Sets the input and output sample rate as a ratio.
The ration is in/out.
resampler_uninit ¶
resampler_uninit :: proc "c" (pResampler: ^resampler, pAllocationCallbacks: ^allocation_callbacks) ---
Uninitializes a resampler.
resource_manager_config_init ¶
resource_manager_config_init :: proc "c" () -> resource_manager_config ---
resource_manager_data_buffer_get_available_frames ¶
resource_manager_data_buffer_get_available_frames :: proc "c" (pDataBuffer: ^resource_manager_data_buffer, pAvailableFrames: ^u64) -> result ---
resource_manager_data_buffer_get_cursor_in_pcm_frames ¶
resource_manager_data_buffer_get_cursor_in_pcm_frames :: proc "c" (pDataBuffer: ^resource_manager_data_buffer, pCursor: ^u64) -> result ---
resource_manager_data_buffer_get_length_in_pcm_frames ¶
resource_manager_data_buffer_get_length_in_pcm_frames :: proc "c" (pDataBuffer: ^resource_manager_data_buffer, pLength: ^u64) -> result ---
resource_manager_data_buffer_init ¶
resource_manager_data_buffer_init :: proc "c" (pResourceManager: ^resource_manager, pFilePath: cstring, flags: u32, pNotifications: ^resource_manager_pipeline_notifications, pDataBuffer: ^resource_manager_data_buffer) -> result ---
resource_manager_data_buffer_init_copy ¶
resource_manager_data_buffer_init_copy :: proc "c" (pResourceManager: ^resource_manager, pExistingDataBuffer, pDataBuffer: ^resource_manager_data_buffer) -> result ---
resource_manager_data_buffer_init_ex ¶
resource_manager_data_buffer_init_ex :: proc "c" (pResourceManager: ^resource_manager, pConfig: ^resource_manager_data_source_config, pDataBuffer: ^resource_manager_data_buffer) -> result ---
Data Buffers.
resource_manager_data_buffer_init_w ¶
resource_manager_data_buffer_init_w :: proc "c" (pResourceManager: ^resource_manager, pFilePath: [^]u16, flags: u32, pNotifications: ^resource_manager_pipeline_notifications, pDataBuffer: ^resource_manager_data_buffer) -> result ---
resource_manager_data_buffer_is_looping ¶
resource_manager_data_buffer_is_looping :: proc "c" (pDataBuffer: ^resource_manager_data_buffer) -> b32 ---
resource_manager_data_buffer_read_pcm_frames ¶
resource_manager_data_buffer_read_pcm_frames :: proc "c" (pDataBuffer: ^resource_manager_data_buffer, pFramesOut: rawptr, frameCount: u64, pFramesRead: ^u64) -> result ---
resource_manager_data_buffer_result ¶
resource_manager_data_buffer_result :: proc "c" (pDataBuffer: ^resource_manager_data_buffer) -> result ---
resource_manager_data_buffer_seek_to_pcm_frame ¶
resource_manager_data_buffer_seek_to_pcm_frame :: proc "c" (pDataBuffer: ^resource_manager_data_buffer, frameIndex: u64) -> result ---
resource_manager_data_buffer_set_looping ¶
resource_manager_data_buffer_set_looping :: proc "c" (pDataBuffer: ^resource_manager_data_buffer, isLooping: b32) -> result ---
resource_manager_data_buffer_uninit ¶
resource_manager_data_buffer_uninit :: proc "c" (pDataBuffer: ^resource_manager_data_buffer) -> result ---
resource_manager_data_source_config_init ¶
resource_manager_data_source_config_init :: proc "c" () -> resource_manager_data_source_config ---
resource_manager_data_source_get_available_frames ¶
resource_manager_data_source_get_available_frames :: proc "c" (pDataSource: ^resource_manager_data_source, pAvailableFrames: ^u64) -> result ---
resource_manager_data_source_get_cursor_in_pcm_frames ¶
resource_manager_data_source_get_cursor_in_pcm_frames :: proc "c" (pDataSource: ^resource_manager_data_source, pCursor: ^u64) -> result ---
resource_manager_data_source_get_length_in_pcm_frames ¶
resource_manager_data_source_get_length_in_pcm_frames :: proc "c" (pDataSource: ^resource_manager_data_source, pLength: ^u64) -> result ---
resource_manager_data_source_init ¶
resource_manager_data_source_init :: proc "c" (pResourceManager: ^resource_manager, pName: cstring, flags: u32, pNotifications: ^resource_manager_pipeline_notifications, pDataSource: ^resource_manager_data_source) -> result ---
resource_manager_data_source_init_copy ¶
resource_manager_data_source_init_copy :: proc "c" (pResourceManager: ^resource_manager, pExistingDataSource, pDataSource: ^resource_manager_data_source) -> result ---
resource_manager_data_source_init_ex ¶
resource_manager_data_source_init_ex :: proc "c" (pResourceManager: ^resource_manager, pConfig: ^resource_manager_data_source_config, pDataSource: ^resource_manager_data_source) -> result ---
Data Sources.
resource_manager_data_source_init_w ¶
resource_manager_data_source_init_w :: proc "c" (pResourceManager: ^resource_manager, pName: [^]u16, flags: u32, pNotifications: ^resource_manager_pipeline_notifications, pDataSource: ^resource_manager_data_source) -> result ---
resource_manager_data_source_is_looping ¶
resource_manager_data_source_is_looping :: proc "c" (pDataSource: ^resource_manager_data_source) -> b32 ---
resource_manager_data_source_read_pcm_frames ¶
resource_manager_data_source_read_pcm_frames :: proc "c" (pDataSource: ^resource_manager_data_source, pFramesOut: rawptr, frameCount: u64, pFramesRead: ^u64) -> result ---
resource_manager_data_source_result ¶
resource_manager_data_source_result :: proc "c" (pDataSource: ^resource_manager_data_source) -> result ---
resource_manager_data_source_seek_to_pcm_frame ¶
resource_manager_data_source_seek_to_pcm_frame :: proc "c" (pDataSource: ^resource_manager_data_source, frameIndex: u64) -> result ---
resource_manager_data_source_set_looping ¶
resource_manager_data_source_set_looping :: proc "c" (pDataSource: ^resource_manager_data_source, isLooping: b32) -> result ---
resource_manager_data_source_uninit ¶
resource_manager_data_source_uninit :: proc "c" (pDataSource: ^resource_manager_data_source) -> result ---
resource_manager_data_stream_get_available_frames ¶
resource_manager_data_stream_get_available_frames :: proc "c" (pDataStream: ^resource_manager_data_stream, pAvailableFrames: ^u64) -> result ---
resource_manager_data_stream_get_cursor_in_pcm_frames ¶
resource_manager_data_stream_get_cursor_in_pcm_frames :: proc "c" (pDataStream: ^resource_manager_data_stream, pCursor: ^u64) -> result ---
resource_manager_data_stream_get_length_in_pcm_frames ¶
resource_manager_data_stream_get_length_in_pcm_frames :: proc "c" (pDataStream: ^resource_manager_data_stream, pLength: ^u64) -> result ---
resource_manager_data_stream_init ¶
resource_manager_data_stream_init :: proc "c" (pResourceManager: ^resource_manager, pFilePath: cstring, flags: u32, pNotifications: ^resource_manager_pipeline_notifications, pDataStream: ^resource_manager_data_stream) -> result ---
resource_manager_data_stream_init_ex ¶
resource_manager_data_stream_init_ex :: proc "c" (pResourceManager: ^resource_manager, pConfig: ^resource_manager_data_source_config, pDataStream: ^resource_manager_data_stream) -> result ---
Data Streams.
resource_manager_data_stream_init_w ¶
resource_manager_data_stream_init_w :: proc "c" (pResourceManager: ^resource_manager, pFilePath: [^]u16, flags: u32, pNotifications: ^resource_manager_pipeline_notifications, pDataStream: ^resource_manager_data_stream) -> result ---
resource_manager_data_stream_is_looping ¶
resource_manager_data_stream_is_looping :: proc "c" (pDataStream: ^resource_manager_data_stream) -> b32 ---
resource_manager_data_stream_read_pcm_frames ¶
resource_manager_data_stream_read_pcm_frames :: proc "c" (pDataStream: ^resource_manager_data_stream, pFramesOut: rawptr, frameCount: u64, pFramesRead: ^u64) -> result ---
resource_manager_data_stream_result ¶
resource_manager_data_stream_result :: proc "c" (pDataStream: ^resource_manager_data_stream) -> result ---
resource_manager_data_stream_seek_to_pcm_frame ¶
resource_manager_data_stream_seek_to_pcm_frame :: proc "c" (pDataStream: ^resource_manager_data_stream, frameIndex: u64) -> result ---
resource_manager_data_stream_set_looping ¶
resource_manager_data_stream_set_looping :: proc "c" (pDataStream: ^resource_manager_data_stream, isLooping: b32) -> result ---
resource_manager_data_stream_uninit ¶
resource_manager_data_stream_uninit :: proc "c" (pDataStream: ^resource_manager_data_stream) -> result ---
resource_manager_get_log ¶
resource_manager_get_log :: proc "c" (pResourceManager: ^resource_manager) -> ^log ---
resource_manager_init ¶
resource_manager_init :: proc "c" (pConfig: ^resource_manager_config, pResourceManager: ^resource_manager) -> result ---
Init.
resource_manager_job_init ¶
resource_manager_job_init :: job_init
resource_manager_job_queue_config_init ¶
resource_manager_job_queue_config_init :: job_queue_config_init
resource_manager_job_queue_get_heap_size ¶
resource_manager_job_queue_get_heap_size :: job_queue_get_heap_size
resource_manager_job_queue_init ¶
resource_manager_job_queue_init :: job_queue_init
resource_manager_job_queue_init_preallocated ¶
resource_manager_job_queue_init_preallocated :: job_queue_init_preallocated
resource_manager_job_queue_next ¶
resource_manager_job_queue_next :: job_queue_next
Returns MA_CANCELLED if the next job is a quit job.
resource_manager_job_queue_post ¶
resource_manager_job_queue_post :: job_queue_post
resource_manager_job_queue_uninit ¶
resource_manager_job_queue_uninit :: job_queue_uninit
resource_manager_next_job ¶
resource_manager_next_job :: proc "c" (pResourceManager: ^resource_manager, pJob: ^job) -> result ---
resource_manager_pipeline_notifications_init ¶
resource_manager_pipeline_notifications_init :: proc "c" () -> resource_manager_pipeline_notifications ---
resource_manager_post_job ¶
resource_manager_post_job :: proc "c" (pResourceManager: ^resource_manager, pJob: ^job) -> result ---
Job management.
resource_manager_post_job_quit ¶
resource_manager_post_job_quit :: proc "c" (pResourceManager: ^resource_manager) -> result ---
Helper for posting a quit job.
resource_manager_process_job ¶
resource_manager_process_job :: proc "c" (pResourceManager: ^resource_manager, pJob: ^job) -> result ---
DEPRECATED. Use ma_job_process(). Will be removed in version 0.12.
resource_manager_process_next_job ¶
resource_manager_process_next_job :: proc "c" (pResourceManager: ^resource_manager) -> result ---
Returns MA_CANCELLED if a MA_JOB_TYPE_QUIT job is found. In non-blocking mode, returns MA_NO_DATA_AVAILABLE if no jobs are available.
resource_manager_register_decoded_data ¶
resource_manager_register_decoded_data :: proc "c" ( pResourceManager: ^resource_manager, pName: cstring, pData: rawptr, frameCount: u64, format: format, channels: u32, sampleRate: u32, ) -> result ---
Does not copy. Increments the reference count if already exists and returns MA_SUCCESS.
resource_manager_register_encoded_data ¶
resource_manager_register_encoded_data :: proc "c" (pResourceManager: ^resource_manager, pName: cstring, pData: rawptr, sizeInBytes: uint) -> result ---
Does not copy. Increments the reference count if already exists and returns MA_SUCCESS.
resource_manager_register_encoded_data_w ¶
resource_manager_register_encoded_data_w :: proc "c" (pResourceManager: ^resource_manager, pName: [^]u16, pData: rawptr, sizeInBytes: uint) -> result ---
resource_manager_register_file ¶
resource_manager_register_file :: proc "c" (pResourceManager: ^resource_manager, pFilePath: cstring, flags: u32) -> result ---
Registration.
resource_manager_register_file_w ¶
resource_manager_register_file_w :: proc "c" (pResourceManager: ^resource_manager, pFilePath: [^]u16, flags: u32) -> result ---
resource_manager_uninit ¶
resource_manager_uninit :: proc "c" (pResourceManager: ^resource_manager) ---
resource_manager_unregister_data ¶
resource_manager_unregister_data :: proc "c" (pResourceManager: ^resource_manager, pName: cstring) -> result ---
resource_manager_unregister_data_w ¶
resource_manager_unregister_data_w :: proc "c" (pResourceManager: ^resource_manager, pName: [^]u16) -> result ---
resource_manager_unregister_file ¶
resource_manager_unregister_file :: proc "c" (pResourceManager: ^resource_manager, pFilePath: cstring) -> result ---
resource_manager_unregister_file_w ¶
resource_manager_unregister_file_w :: proc "c" (pResourceManager: ^resource_manager, pFilePath: [^]u16) -> result ---
result_description ¶
Retrieves a human readable description of the given result code.
silence_pcm_frames ¶
Copies silent frames into the given buffer.
Remarks
-------
For all formats except ma_format_u8
, the output buffer will be filled with 0. For ma_format_u8
it will be filled with 128. The reason for this is that it
makes more sense for the purpose of mixing to initialize it to the center point.
slot_allocator_alloc ¶
slot_allocator_alloc :: proc "c" (pAllocator: ^slot_allocator, pSlot: ^u64) -> result ---
slot_allocator_config_init ¶
slot_allocator_config_init :: proc "c" (capacity: u32) -> slot_allocator_config ---
slot_allocator_free ¶
slot_allocator_free :: proc "c" (pAllocator: ^slot_allocator, slot: u64) -> result ---
slot_allocator_get_heap_size ¶
slot_allocator_get_heap_size :: proc "c" (pConfig: ^slot_allocator_config, pHeapSizeInBytes: ^uint) -> result ---
slot_allocator_init ¶
slot_allocator_init :: proc "c" (pConfig: ^slot_allocator_config, pAllocationCallbacks: ^allocation_callbacks, pAllocator: ^slot_allocator) -> result ---
slot_allocator_init_preallocated ¶
slot_allocator_init_preallocated :: proc "c" (pConfig: ^slot_allocator_config, pHeap: rawptr, pAllocator: ^slot_allocator) -> result ---
slot_allocator_uninit ¶
slot_allocator_uninit :: proc "c" (pAllocator: ^slot_allocator, pAllocationCallbacks: ^allocation_callbacks) ---
sound_config_init ¶
sound_config_init :: proc "c" () -> sound_config ---
sound_config_init2 ¶
sound_config_init2 :: proc "c" (pEngine: ^engine) -> sound_config ---
Will be renamed to sound_config_init() in version 0.12.
sound_get_attenuation_model ¶
sound_get_attenuation_model :: proc "c" (pSound: ^sound) -> attenuation_model ---
sound_get_data_source ¶
sound_get_data_source :: proc "c" (pSound: ^sound) -> ^data_source ---
sound_get_positioning ¶
sound_get_positioning :: proc "c" (pSound: ^sound) -> positioning ---
sound_group_config_init ¶
sound_group_config_init :: proc "c" () -> sound_group_config ---
sound_group_config_init2 ¶
sound_group_config_init2 :: proc "c" (pEngine: ^engine) -> sound_group_config ---
sound_group_get_attenuation_model ¶
sound_group_get_attenuation_model :: proc "c" (pGroup: ^sound_group) -> attenuation_model ---
sound_group_get_cone ¶
sound_group_get_cone :: proc "c" (pGroup: ^sound_group, pInnerAngleInRadians, pOuterAngleInRadians, pOuterGain: ^f32) ---
sound_group_get_current_fade_volume ¶
sound_group_get_current_fade_volume :: proc "c" (pGroup: ^sound_group) -> f32 ---
sound_group_get_direction ¶
sound_group_get_direction :: proc "c" (pGroup: ^sound_group) -> vec3f ---
sound_group_get_direction_to_listener ¶
sound_group_get_direction_to_listener :: proc "c" (pGroup: ^sound_group) -> vec3f ---
sound_group_get_directional_attenuation_factor ¶
sound_group_get_directional_attenuation_factor :: proc "c" (pGroup: ^sound_group) -> f32 ---
sound_group_get_doppler_factor ¶
sound_group_get_doppler_factor :: proc "c" (pGroup: ^sound_group) -> f32 ---
sound_group_get_engine ¶
sound_group_get_engine :: proc "c" (pGroup: ^sound_group) -> ^engine ---
sound_group_get_listener_index ¶
sound_group_get_listener_index :: proc "c" (pGroup: ^sound_group) -> u32 ---
sound_group_get_max_distance ¶
sound_group_get_max_distance :: proc "c" (pGroup: ^sound_group) -> f32 ---
sound_group_get_max_gain ¶
sound_group_get_max_gain :: proc "c" (pGroup: ^sound_group) -> f32 ---
sound_group_get_min_distance ¶
sound_group_get_min_distance :: proc "c" (pGroup: ^sound_group) -> f32 ---
sound_group_get_min_gain ¶
sound_group_get_min_gain :: proc "c" (pGroup: ^sound_group) -> f32 ---
sound_group_get_pan ¶
sound_group_get_pan :: proc "c" (pGroup: ^sound_group) -> f32 ---
sound_group_get_pan_mode ¶
sound_group_get_pan_mode :: proc "c" (pGroup: ^sound_group) -> pan_mode ---
sound_group_get_pinned_listener_index ¶
sound_group_get_pinned_listener_index :: proc "c" (pGroup: ^sound_group) -> u32 ---
sound_group_get_pitch ¶
sound_group_get_pitch :: proc "c" (pGroup: ^sound_group) -> f32 ---
sound_group_get_position ¶
sound_group_get_position :: proc "c" (pGroup: ^sound_group) -> vec3f ---
sound_group_get_positioning ¶
sound_group_get_positioning :: proc "c" (pGroup: ^sound_group) -> positioning ---
sound_group_get_rolloff ¶
sound_group_get_rolloff :: proc "c" (pGroup: ^sound_group) -> f32 ---
sound_group_get_time_in_pcm_frames ¶
sound_group_get_time_in_pcm_frames :: proc "c" (pGroup: ^sound_group) -> u64 ---
sound_group_get_velocity ¶
sound_group_get_velocity :: proc "c" (pGroup: ^sound_group) -> vec3f ---
sound_group_get_volume ¶
sound_group_get_volume :: proc "c" (pGroup: ^sound_group) -> f32 ---
sound_group_init ¶
sound_group_init :: proc "c" (pEngine: ^engine, flags: u32, pParentGroup, pGroup: ^sound_group) -> result ---
sound_group_init_ex ¶
sound_group_init_ex :: proc "c" (pEngine: ^engine, pConfig: ^sound_group_config, pGroup: ^sound_group) -> result ---
sound_group_is_playing ¶
sound_group_is_playing :: proc "c" (pGroup: ^sound_group) -> b32 ---
sound_group_is_spatialization_enabled ¶
sound_group_is_spatialization_enabled :: proc "c" (pGroup: ^sound_group) -> b32 ---
sound_group_set_attenuation_model ¶
sound_group_set_attenuation_model :: proc "c" (pGroup: ^sound_group, attenuationModel: attenuation_model) ---
sound_group_set_cone ¶
sound_group_set_cone :: proc "c" (pGroup: ^sound_group, innerAngleInRadians, outerAngleInRadians, outerGain: f32) ---
sound_group_set_direction ¶
sound_group_set_direction :: proc "c" (pGroup: ^sound_group, x, y, z: f32) ---
sound_group_set_directional_attenuation_factor ¶
sound_group_set_directional_attenuation_factor :: proc "c" (pGroup: ^sound_group, directionalAttenuationFactor: f32) ---
sound_group_set_doppler_factor ¶
sound_group_set_doppler_factor :: proc "c" (pGroup: ^sound_group, dopplerFactor: f32) ---
sound_group_set_fade_in_milliseconds ¶
sound_group_set_fade_in_milliseconds :: proc "c" (pGroup: ^sound_group, volumeBeg, volumeEnd: f32, fadeLengthInMilliseconds: u64) ---
sound_group_set_fade_in_pcm_frames ¶
sound_group_set_fade_in_pcm_frames :: proc "c" (pGroup: ^sound_group, volumeBeg, volumeEnd: f32, fadeLengthInFrames: u64) ---
sound_group_set_max_distance ¶
sound_group_set_max_distance :: proc "c" (pGroup: ^sound_group, maxDistance: f32) ---
sound_group_set_max_gain ¶
sound_group_set_max_gain :: proc "c" (pGroup: ^sound_group, maxGain: f32) ---
sound_group_set_min_distance ¶
sound_group_set_min_distance :: proc "c" (pGroup: ^sound_group, minDistance: f32) ---
sound_group_set_min_gain ¶
sound_group_set_min_gain :: proc "c" (pGroup: ^sound_group, minGain: f32) ---
sound_group_set_pan ¶
sound_group_set_pan :: proc "c" (pGroup: ^sound_group, pan: f32) ---
sound_group_set_pan_mode ¶
sound_group_set_pan_mode :: proc "c" (pGroup: ^sound_group, panMode: pan_mode) ---
sound_group_set_pinned_listener_index ¶
sound_group_set_pinned_listener_index :: proc "c" (pGroup: ^sound_group, listenerIndex: u32) ---
sound_group_set_pitch ¶
sound_group_set_pitch :: proc "c" (pGroup: ^sound_group, pitch: f32) ---
sound_group_set_position ¶
sound_group_set_position :: proc "c" (pGroup: ^sound_group, x, y, z: f32) ---
sound_group_set_positioning ¶
sound_group_set_positioning :: proc "c" (pGroup: ^sound_group, positioning: positioning) ---
sound_group_set_rolloff ¶
sound_group_set_rolloff :: proc "c" (pGroup: ^sound_group, rolloff: f32) ---
sound_group_set_spatialization_enabled ¶
sound_group_set_spatialization_enabled :: proc "c" (pGroup: ^sound_group, enabled: b32) ---
sound_group_set_start_time_in_milliseconds ¶
sound_group_set_start_time_in_milliseconds :: proc "c" (pGroup: ^sound_group, absoluteGlobalTimeInMilliseconds: u64) ---
sound_group_set_start_time_in_pcm_frames ¶
sound_group_set_start_time_in_pcm_frames :: proc "c" (pGroup: ^sound_group, absoluteGlobalTimeInFrames: u64) ---
sound_group_set_stop_time_in_milliseconds ¶
sound_group_set_stop_time_in_milliseconds :: proc "c" (pGroup: ^sound_group, absoluteGlobalTimeInMilliseconds: u64) ---
sound_group_set_stop_time_in_pcm_frames ¶
sound_group_set_stop_time_in_pcm_frames :: proc "c" (pGroup: ^sound_group, absoluteGlobalTimeInFrames: u64) ---
sound_group_set_velocity ¶
sound_group_set_velocity :: proc "c" (pGroup: ^sound_group, x, y, z: f32) ---
sound_group_set_volume ¶
sound_group_set_volume :: proc "c" (pGroup: ^sound_group, volume: f32) ---
sound_group_start ¶
sound_group_start :: proc "c" (pGroup: ^sound_group) -> result ---
sound_group_stop ¶
sound_group_stop :: proc "c" (pGroup: ^sound_group) -> result ---
sound_group_uninit ¶
sound_group_uninit :: proc "c" (pGroup: ^sound_group) ---
sound_init_ex ¶
sound_init_ex :: proc "c" (pEngine: ^engine, pConfig: ^sound_config, pSound: ^sound) -> result ---
sound_init_from_data_source ¶
sound_init_from_data_source :: proc "c" (pEngine: ^engine, pDataSource: ^data_source, flags: u32, pGroup: ^sound_group, pSound: ^sound) -> result ---
sound_seek_to_pcm_frame ¶
Just a wrapper around ma_data_source_seek_to_pcm_frame().
sound_set_attenuation_model ¶
sound_set_attenuation_model :: proc "c" (pSound: ^sound, attenuationModel: attenuation_model) ---
sound_set_end_callback ¶
sound_set_end_callback :: proc "c" (pSound: ^sound, callback: sound_end_proc, pUserData: rawptr) ---
sound_set_positioning ¶
sound_set_positioning :: proc "c" (pSound: ^sound, positioning: positioning) ---
sound_stop_with_fade_in_milliseconds ¶
Will overwrite any scheduled stop and fade.
sound_stop_with_fade_in_pcm_frames ¶
Will overwrite any scheduled stop and fade.
sound_uninit ¶
sound_uninit :: proc "c" (pSound: ^sound) ---
spatializer_config_init ¶
spatializer_config_init :: proc "c" (channelsIn, channelsOut: u32) -> spatializer_config ---
spatializer_get_attenuation_model ¶
spatializer_get_attenuation_model :: proc "c" (pSpatializer: ^spatializer) -> attenuation_model ---
spatializer_get_cone ¶
spatializer_get_cone :: proc "c" (pSpatializer: ^spatializer, pInnerAngleInRadians, pOuterAngleInRadians, pOuterGain: ^f32) ---
spatializer_get_direction ¶
spatializer_get_direction :: proc "c" (pSpatializer: ^spatializer) -> vec3f ---
spatializer_get_directional_attenuation_factor ¶
spatializer_get_directional_attenuation_factor :: proc "c" (pSpatializer: ^spatializer) -> f32 ---
spatializer_get_doppler_factor ¶
spatializer_get_doppler_factor :: proc "c" (pSpatializer: ^spatializer) -> f32 ---
spatializer_get_heap_size ¶
spatializer_get_heap_size :: proc "c" (pConfig: ^spatializer_config, pHeapSizeInBytes: ^uint) -> result ---
spatializer_get_input_channels ¶
spatializer_get_input_channels :: proc "c" (pSpatializer: ^spatializer) -> u32 ---
spatializer_get_master_volume ¶
spatializer_get_master_volume :: proc "c" (pSpatializer: ^spatializer, pVolume: ^f32) -> result ---
spatializer_get_max_distance ¶
spatializer_get_max_distance :: proc "c" (pSpatializer: ^spatializer) -> f32 ---
spatializer_get_max_gain ¶
spatializer_get_max_gain :: proc "c" (pSpatializer: ^spatializer) -> f32 ---
spatializer_get_min_distance ¶
spatializer_get_min_distance :: proc "c" (pSpatializer: ^spatializer) -> f32 ---
spatializer_get_min_gain ¶
spatializer_get_min_gain :: proc "c" (pSpatializer: ^spatializer) -> f32 ---
spatializer_get_output_channels ¶
spatializer_get_output_channels :: proc "c" (pSpatializer: ^spatializer) -> u32 ---
spatializer_get_position ¶
spatializer_get_position :: proc "c" (pSpatializer: ^spatializer) -> vec3f ---
spatializer_get_positioning ¶
spatializer_get_positioning :: proc "c" (pSpatializer: ^spatializer) -> positioning ---
spatializer_get_relative_position_and_direction ¶
spatializer_get_relative_position_and_direction :: proc "c" (pSpatializer: ^spatializer, pListener: ^spatializer_listener, pRelativePos, pRelativeDir: ^vec3f) ---
spatializer_get_rolloff ¶
spatializer_get_rolloff :: proc "c" (pSpatializer: ^spatializer) -> f32 ---
spatializer_get_velocity ¶
spatializer_get_velocity :: proc "c" (pSpatializer: ^spatializer) -> vec3f ---
spatializer_init ¶
spatializer_init :: proc "c" (pConfig: ^spatializer_config, pAllocationCallbacks: ^allocation_callbacks, pSpatializer: ^spatializer) -> result ---
spatializer_init_preallocated ¶
spatializer_init_preallocated :: proc "c" (pConfig: ^spatializer_config, pHeap: rawptr, pSpatializer: ^spatializer) -> result ---
spatializer_listener_config_init ¶
spatializer_listener_config_init :: proc "c" (channelsOut: u32) -> spatializer_listener_config ---
spatializer_listener_get_channel_map ¶
spatializer_listener_get_channel_map :: proc "c" (pListener: ^spatializer_listener) -> ^channel ---
spatializer_listener_get_cone ¶
spatializer_listener_get_cone :: proc "c" (pListener: ^spatializer_listener, pInnerAngleInRadians, pOuterAngleInRadians, pOuterGain: ^f32) ---
spatializer_listener_get_direction ¶
spatializer_listener_get_direction :: proc "c" (pListener: ^spatializer_listener) -> vec3f ---
spatializer_listener_get_heap_size ¶
spatializer_listener_get_heap_size :: proc "c" (pConfig: ^spatializer_listener_config, pHeapSizeInBytes: ^uint) -> result ---
spatializer_listener_get_position ¶
spatializer_listener_get_position :: proc "c" (pListener: ^spatializer_listener) -> vec3f ---
spatializer_listener_get_speed_of_sound ¶
spatializer_listener_get_speed_of_sound :: proc "c" (pListener: ^spatializer_listener) -> f32 ---
spatializer_listener_get_velocity ¶
spatializer_listener_get_velocity :: proc "c" (pListener: ^spatializer_listener) -> vec3f ---
spatializer_listener_get_world_up ¶
spatializer_listener_get_world_up :: proc "c" (pListener: ^spatializer_listener) -> vec3f ---
spatializer_listener_init ¶
spatializer_listener_init :: proc "c" (pConfig: ^spatializer_listener_config, pAllocationCallbacks: ^allocation_callbacks, pListener: ^spatializer_listener) -> result ---
spatializer_listener_init_preallocated ¶
spatializer_listener_init_preallocated :: proc "c" (pConfig: ^spatializer_listener_config, pHeap: rawptr, pListener: ^spatializer_listener) -> result ---
spatializer_listener_is_enabled ¶
spatializer_listener_is_enabled :: proc "c" (pListener: ^spatializer_listener) -> b32 ---
spatializer_listener_set_cone ¶
spatializer_listener_set_cone :: proc "c" (pListener: ^spatializer_listener, innerAngleInRadians, outerAngleInRadians, outerGain: f32) ---
spatializer_listener_set_direction ¶
spatializer_listener_set_direction :: proc "c" (pListener: ^spatializer_listener, x, y, z: f32) ---
spatializer_listener_set_enabled ¶
spatializer_listener_set_enabled :: proc "c" (pListener: ^spatializer_listener, isEnabled: b32) ---
spatializer_listener_set_position ¶
spatializer_listener_set_position :: proc "c" (pListener: ^spatializer_listener, x, y, z: f32) ---
spatializer_listener_set_speed_of_sound ¶
spatializer_listener_set_speed_of_sound :: proc "c" (pListener: ^spatializer_listener, speedOfSound: f32) ---
spatializer_listener_set_velocity ¶
spatializer_listener_set_velocity :: proc "c" (pListener: ^spatializer_listener, x, y, z: f32) ---
spatializer_listener_set_world_up ¶
spatializer_listener_set_world_up :: proc "c" (pListener: ^spatializer_listener, x, y, z: f32) ---
spatializer_listener_uninit ¶
spatializer_listener_uninit :: proc "c" (pListener: ^spatializer_listener, pAllocationCallbacks: ^allocation_callbacks) ---
spatializer_process_pcm_frames ¶
spatializer_process_pcm_frames :: proc "c" (pSpatializer: ^spatializer, pListener: ^spatializer_listener, pFramesOut, pFramesIn: rawptr, frameCount: u64) -> result ---
spatializer_set_attenuation_model ¶
spatializer_set_attenuation_model :: proc "c" (pSpatializer: ^spatializer, attenuationModel: attenuation_model) ---
spatializer_set_cone ¶
spatializer_set_cone :: proc "c" (pSpatializer: ^spatializer, innerAngleInRadians, outerAngleInRadians, outerGain: f32) ---
spatializer_set_direction ¶
spatializer_set_direction :: proc "c" (pSpatializer: ^spatializer, x, y, z: f32) ---
spatializer_set_directional_attenuation_factor ¶
spatializer_set_directional_attenuation_factor :: proc "c" (pSpatializer: ^spatializer, directionalAttenuationFactor: f32) ---
spatializer_set_doppler_factor ¶
spatializer_set_doppler_factor :: proc "c" (pSpatializer: ^spatializer, dopplerFactor: f32) ---
spatializer_set_master_volume ¶
spatializer_set_master_volume :: proc "c" (pSpatializer: ^spatializer, volume: f32) -> result ---
spatializer_set_max_distance ¶
spatializer_set_max_distance :: proc "c" (pSpatializer: ^spatializer, maxDistance: f32) ---
spatializer_set_max_gain ¶
spatializer_set_max_gain :: proc "c" (pSpatializer: ^spatializer, maxGain: f32) ---
spatializer_set_min_distance ¶
spatializer_set_min_distance :: proc "c" (pSpatializer: ^spatializer, minDistance: f32) ---
spatializer_set_min_gain ¶
spatializer_set_min_gain :: proc "c" (pSpatializer: ^spatializer, minGain: f32) ---
spatializer_set_position ¶
spatializer_set_position :: proc "c" (pSpatializer: ^spatializer, x, y, z: f32) ---
spatializer_set_positioning ¶
spatializer_set_positioning :: proc "c" (pSpatializer: ^spatializer, positioning: positioning) ---
spatializer_set_rolloff ¶
spatializer_set_rolloff :: proc "c" (pSpatializer: ^spatializer, rolloff: f32) ---
spatializer_set_velocity ¶
spatializer_set_velocity :: proc "c" (pSpatializer: ^spatializer, x, y, z: f32) ---
spatializer_uninit ¶
spatializer_uninit :: proc "c" (pSpatializer: ^spatializer, pAllocationCallbacks: ^allocation_callbacks) ---
spinlock_lock ¶
Locks a spinlock.
spinlock_lock_noyield ¶
Locks a spinlock, but does not yield() when looping.
spinlock_unlock ¶
Unlocks a spinlock.
splitter_node_config_init ¶
splitter_node_config_init :: proc "c" (channels: u32) -> splitter_node_config ---
splitter_node_init ¶
splitter_node_init :: proc "c" (pNodeGraph: ^node_graph, pConfig: ^splitter_node_config, pAllocationCallbacks: ^allocation_callbacks, pSplitterNode: ^splitter_node) -> result ---
splitter_node_uninit ¶
splitter_node_uninit :: proc "c" (pSplitterNode: ^splitter_node, pAllocationCallbacks: ^allocation_callbacks) ---
version_check ¶
version_check :: proc() {…}
version_string ¶
version_string :: proc "c" () -> cstring ---
vfs_seek ¶
vfs_seek :: proc "c" (pVFS: ^vfs, file: vfs_file, offset: i64, origin: seek_origin) -> result ---
volume_db_to_linear ¶
Helper for converting gain in decibels to a linear factor.
volume_linear_to_db ¶
Helper for converting a linear factor to gain in decibels.
waveform_config_init ¶
waveform_config_init :: proc "c" ( format: format, channels: u32, sampleRate: u32, type: waveform_type, amplitude: f64, frequency: f64, ) -> waveform_config ---
waveform_init ¶
waveform_init :: proc "c" (pConfig: ^waveform_config, pWaveform: ^waveform) -> result ---
waveform_set_type ¶
waveform_set_type :: proc "c" (pWaveform: ^waveform, type: waveform_type) -> result ---
waveform_uninit ¶
waveform_uninit :: proc "c" (pWaveform: ^waveform) ---
Procedure Groups
This section is empty.
Source Files
- common.odin
- data_conversion.odin
- decoding.odin
- device_io_procs.odin
- device_io_types.odin
- doc.odin
- effects.odin
- encoding.odin
- engine.odin
- filtering.odin
- generation.odin
- job_queue.odin
- logging.odin
- node_graph.odin
- resource_manager.odin
- synchronization.odin
- utilities.odin
- vfs.odin
- (hidden platform specific files)
Generation Information
Generated with odin version dev-2024-11 (vendor "odin") Windows_amd64 @ 2024-11-20 21:11:52.230594000 +0000 UTC