package vendor:miniaudio

Index

Types (234)
Variables (0)

This section is empty.

Procedures (882)
Procedure Groups (0)

This section is empty.

Types

IMMNotificationClient ¶

IMMNotificationClient :: struct {
	lpVtbl:  rawptr,
	counter: u32,
	pDevice: ^device,
}

aaudio_content_type ¶

aaudio_content_type :: enum i32 {
	default      = 0, // Leaves the content type unset.
	movie,            // AAUDIO_CONTENT_TYPE_MOVIE
	music,            // AAUDIO_CONTENT_TYPE_MUSIC
	sonification,     // AAUDIO_CONTENT_TYPE_SONIFICATION
	speech,           // AAUDIO_CONTENT_TYPE_SPEECH
}
 

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
	unprocessed,             // AAUDIO_INPUT_PRESET_UNPROCESSED
	voice_recognition,       // AAUDIO_INPUT_PRESET_VOICE_RECOGNITION
	voice_communication,     // AAUDIO_INPUT_PRESET_VOICE_COMMUNICATION
	voice_performance,       // AAUDIO_INPUT_PRESET_VOICE_PERFORMANCE
}
 

AAudio input presets.

aaudio_usage ¶

aaudio_usage :: enum i32 {
	default                        = 0, // Leaves the usage type unset.
	announcement,                       // AAUDIO_SYSTEM_USAGE_ANNOUNCEMENT
	emergency,                          // AAUDIO_SYSTEM_USAGE_EMERGENCY
	safety,                             // AAUDIO_SYSTEM_USAGE_SAFETY
	vehicle_status,                     // AAUDIO_SYSTEM_USAGE_VEHICLE_STATUS
	alarm,                              // AAUDIO_USAGE_ALARM
	assistance_accessibility,           // AAUDIO_USAGE_ASSISTANCE_ACCESSIBILITY
	assistance_navigation_guidance,     // AAUDIO_USAGE_ASSISTANCE_NAVIGATION_GUIDANCE
	assistance_sonification,            // AAUDIO_USAGE_ASSISTANCE_SONIFICATION
	assitant,                           // AAUDIO_USAGE_ASSISTANT
	game,                               // AAUDIO_USAGE_GAME
	media,                              // AAUDIO_USAGE_MEDIA
	notification,                       // AAUDIO_USAGE_NOTIFICATION
	notification_event,                 // AAUDIO_USAGE_NOTIFICATION_EVENT
	notification_ringtone,              // AAUDIO_USAGE_NOTIFICATION_RINGTONE
	voice_communication,                // AAUDIO_USAGE_VOICE_COMMUNICATION
	voice_communication_signalling,     // AAUDIO_USAGE_VOICE_COMMUNICATION_SIGNALLING
}
 

AAudio usage types.

allocation_callbacks ¶

allocation_callbacks :: struct {
	pUserData: rawptr,
	onMalloc:  proc "cdecl" (sz: uint, pUserData: rawptr) -> rawptr,
	onRealloc: proc "cdecl" (p: rawptr, sz: uint, pUserData: rawptr) -> rawptr,
	onFree:    proc "cdecl" (opaque: rawptr, address: rawptr),
}

async_notification ¶

async_notification :: struct($Key: typeid, $Value: typeid) where intrinsics.type_is_valid_map_key(Key) {}
 

Notification callback for asynchronous operations.

async_notification_callbacks ¶

async_notification_callbacks :: struct {
	onSignal: proc "cdecl" (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.

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()

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.
}

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,
}

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,
}

audio_buffer_ref ¶

audio_buffer_ref :: struct {
	ds:           data_source_base,
	format:       format,
	channels:     u32,
	sampleRate:   u32,
	cursor:       u64,
	sizeInFrames: u64,
	pData:        rawptr,
}

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.

backend_callbacks ¶

backend_callbacks :: struct {
	onContextInit:             proc "cdecl" (pContext: ^context_type, pConfig: ^context_config, pCallbacks: ^backend_callbacks) -> result,
	onContextUninit:           proc "cdecl" (pContext: ^context_type) -> result,
	onContextEnumerateDevices: proc "cdecl" (pContext: ^context_type, callback: enum_devices_callback_proc, pUserData: rawptr) -> result,
	onContextGetDeviceInfo:    proc "cdecl" (pContext: ^context_type, deviceType: device_type, pDeviceID: ^device_id, pDeviceInfo: ^device_info) -> result,
	onDeviceInit:              proc "cdecl" (pDevice: ^device, pConfig: ^device_config, pDescriptorPlayback, pDescriptorCapture: ^device_descriptor) -> result,
	onDeviceUninit:            proc "cdecl" (pDevice: ^device) -> result,
	onDeviceStart:             proc "cdecl" (pDevice: ^device) -> result,
	onDeviceStop:              proc "cdecl" (pDevice: ^device) -> result,
	onDeviceRead:              proc "cdecl" (pDevice: ^device, pFrames: rawptr, frameCount: u32, pFramesRead: ^u32) -> result,
	onDeviceWrite:             proc "cdecl" (pDevice: ^device, pFrames: rawptr, frameCount: u32, pFramesRead: ^u32) -> result,
	onDeviceDataLoop:          proc "cdecl" (pDevice: ^device) -> result,
	onDeviceDataLoopWakeup:    proc "cdecl" (pDevice: ^device) -> result,
	onDeviceGetInfo:           proc "cdecl" (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_data_format 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 encounted. 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,
}

biquad_coefficient ¶

biquad_coefficient :: struct #raw_union {
	f32: f32,
	s32: i32,
}
 

*************************************************************************************************************************************************************

Biquad Filtering

*************************************************************************************************************************************************************

biquad_config ¶

biquad_config :: struct {
	format:   format,
	channels: u32,
	b0:       f64,
	b1:       f64,
	b2:       f64,
	a0:       f64,
	a1:       f64,
	a2:       f64,
}

biquad_node ¶

biquad_node :: struct {
	baseNode: node_base,
	biquad:   biquad,
}

biquad_node_config ¶

biquad_node_config :: struct {
	nodeConfig: node_config,
	biquad:     biquad_config,
}
 

Biquad Node

bpf ¶

bpf :: struct {
	format:    format,
	channels:  u32,
	bpf2Count: u32,
	pBPF2:     ^bpf2,
	// Memory management. 
	_pHeap:    rawptr,
	_ownsHeap: b32,
}

bpf2 ¶

bpf2 :: struct {
	bq: biquad,
}

bpf2_config ¶

bpf2_config :: struct {
	format:          format,
	channels:        u32,
	sampleRate:      u32,
	cutoffFrequency: f64,
	q:               f64,
}
 

*************************************************************************************************************************************************************

Band-Pass Filtering

*************************************************************************************************************************************************************

bpf_config ¶

bpf_config :: struct {
	format:          format,
	channels:        u32,
	sampleRate:      u32,
	cutoffFrequency: f64,
	order:           u32,
}

bpf_node ¶

bpf_node :: struct {
	baseNode: node_base,
	bpf:      bpf,
}

bpf_node_config ¶

bpf_node_config :: struct {
	nodeConfig: node_config,
	bpf:        bpf_config,
}
 

Band Pass Filter Node

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, 
}

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,
}

channel_converter_config ¶

channel_converter_config :: struct {
	format:         format,
	channelsIn:     u32,
	channelsOut:    u32,
	pChannelMapIn:  [^]channel,
	pChannelMapOut: [^]channel,
	mixingMode:     channel_mix_mode,
	ppWeights:      ^[^]f32,
}

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_router_config.
	default        = 0, 
}

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,
}

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. 
	_:                       struct #raw_union {
		wasapi:       struct {
			commandThread: thread,
			commandLock:   mutex,
			commandSem:    semaphore,
			commandIndex:  u32,
			commandCount:  u32,
			commands:      [4]context_command__wasapi,
		},
		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($Key: typeid, $Value: typeid) where intrinsics.type_is_valid_map_key(Key) {},
		pulse:        struct($Key: typeid, $Value: typeid) where intrinsics.type_is_valid_map_key(Key) {},
		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($Key: typeid, $Value: typeid) where intrinsics.type_is_valid_map_key(Key) {},
		sndio:        struct($Key: typeid, $Value: typeid) where intrinsics.type_is_valid_map_key(Key) {},
		audio4:       struct($Key: typeid, $Value: typeid) where intrinsics.type_is_valid_map_key(Key) {},
		oss:          struct($Key: typeid, $Value: typeid) where intrinsics.type_is_valid_map_key(Key) {},
		aaudio:       struct($Key: typeid, $Value: typeid) where intrinsics.type_is_valid_map_key(Key) {},
		opensl:       struct($Key: typeid, $Value: typeid) where intrinsics.type_is_valid_map_key(Key) {},
		webaudio:     struct($Key: typeid, $Value: typeid) where intrinsics.type_is_valid_map_key(Key) {},
		null_backend: struct {
			_unused: i32,
		},
	},
	_:                       struct #raw_union {
		win32:   struct {
			hOle32DLL:           handle,
			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" (),
		},
		posix:   struct($Key: typeid, $Value: typeid) where intrinsics.type_is_valid_map_key(Key) {},
		_unused: i32,
	},
}

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,
}

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,
	ppChannelWeights:       ^[^]f32,
	// [in][out]. Only used when channelMixMode is set to ma_channel_mix_mode_custom_weights. 
	allowDynamicSampleRate: b32,
	resampling:             resampler_config,
}
 

*************************************************************************************************************************************************************

Data Conversion

*************************************************************************************************************************************************************

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($Key: typeid, $Value: typeid) where intrinsics.type_is_valid_map_key(Key) {}

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,
}

data_source_get_next_proc ¶

data_source_get_next_proc :: proc "cdecl" (pDataSource: ^data_source) -> ^data_source

data_source_node ¶

data_source_node :: struct {
	base:        node_base,
	pDataSource: ^data_source,
}

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.

data_source_vtable ¶

data_source_vtable :: struct {
	onRead:          proc "cdecl" (pDataSource: ^data_source, pFramesOut: rawptr, frameCount: u64, pFramesRead: ^u64) -> result,
	onSeek:          proc "cdecl" (pDataSource: ^data_source, frameIndex: u64) -> result,
	onGetDataFormat: proc "cdecl" (pDataSource: ^data_source, pFormat: ^format, pChannels: ^u32, pSampleRate: ^u32, pChannelMap: [^]channel, channelMapCap: uint) -> result,
	onGetCursor:     proc "cdecl" (pDataSource: ^data_source, pCursor: ^u64) -> result,
	onGetLength:     proc "cdecl" (pDataSource: ^data_source, pCursor: ^u64) -> result,
	onSetLooping:    proc "cdecl" (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,
		},
	},
}

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,
}

decoder_read_proc ¶

decoder_read_proc :: proc "cdecl" (pDecoder: ^decoder, pBufferOut: rawptr, bytesToRead: uint, pBytesRead: ^uint) -> result

decoder_seek_proc ¶

decoder_seek_proc :: proc "cdecl" (pDecoder: ^decoder, byteOffset: i64, origin: seek_origin) -> result

decoder_tell_proc ¶

decoder_tell_proc :: proc "cdecl" (pDecoder: ^decoder, pCursor: ^i64) -> result

decoding_backend_config ¶

decoding_backend_config :: struct {
	preferredFormat: format,
	seekPointCount:  u32,
}

decoding_backend_vtable ¶

decoding_backend_vtable :: struct {
	onInit:       proc "cdecl" (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 "cdecl" (pUserData: rawptr, pFilePath: cstring, pConfig: ^decoding_backend_config, pAllocationCallbacks: ^allocation_callbacks, ppBackend: ^^data_source) -> result,
	// Optional. 
	onInitFileW:  proc "cdecl" (pUserData: rawptr, pFilePath: [^]u16, pConfig: ^decoding_backend_config, pAllocationCallbacks: ^allocation_callbacks, ppBackend: ^^data_source) -> result,
	// Optional. 
	onInitMemory: proc "cdecl" (pUserData: rawptr, pData: rawptr, dataSize: uint, pConfig: ^decoding_backend_config, pAllocationCallbacks: ^allocation_callbacks, ppBackend: ^^data_source) -> result,
	// Optional. 
	onUninit:     proc "cdecl" (pUserData: rawptr, pBackend: ^data_source, pAllocationCallbacks: ^allocation_callbacks),
}

default_vfs ¶

default_vfs :: struct {
	cb:                  vfs_callbacks,
	allocationCallbacks: allocation_callbacks,
}

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,
	// The maximum of config.startDelayInFrames and config.feedbackDelayInFrames. 
	pBuffer:            [^]f32,
}

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

delay_node ¶

delay_node :: struct {
	baseNode: node_base,
	delay:    delay,
}

delay_node_config ¶

delay_node_config :: struct {
	nodeConfig: node_config,
	delay:      delay_config,
}
 

Delay Filter Node

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,
		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,
		converter:                  data_converter,
		pIntermediaryBuffer:        rawptr,
		// For implementing fixed sized buffer callbacks. Will be null if using variable sized callbacks. 
		intermediaryBufferCap:      u32,
		intermediaryBufferLen:      u32,
	},
	_:                         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. 
			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,
		},
		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($Key: typeid, $Value: typeid) where intrinsics.type_is_valid_map_key(Key) {},
		pulse:       struct($Key: typeid, $Value: typeid) where intrinsics.type_is_valid_map_key(Key) {},
		jack:        struct {
			pClient:                     rawptr,
			pPortsPlayback:              [^]rawptr,
			pPortsCapture:               [^]rawptr,
			pIntermediaryBufferPlayback: [^]f32,
			// Typed as a float because JACK is always floating point. 
			pIntermediaryBufferCapture:  [^]f32,
		},
		coreaudio:   struct($Key: typeid, $Value: typeid) where intrinsics.type_is_valid_map_key(Key) {},
		sndio:       struct($Key: typeid, $Value: typeid) where intrinsics.type_is_valid_map_key(Key) {},
		audio4:      struct($Key: typeid, $Value: typeid) where intrinsics.type_is_valid_map_key(Key) {},
		oss:         struct($Key: typeid, $Value: typeid) where intrinsics.type_is_valid_map_key(Key) {},
		aaudio:      struct($Key: typeid, $Value: typeid) where intrinsics.type_is_valid_map_key(Key) {},
		opensl:      struct($Key: typeid, $Value: typeid) where intrinsics.type_is_valid_map_key(Key) {},
		webaudio:    struct($Key: typeid, $Value: typeid) where intrinsics.type_is_valid_map_key(Key) {},
		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,
		},
	},
}

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 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,
		shareMode:      share_mode,
	},
	capture:                   struct {
		pDeviceID:      ^device_id,
		format:         format,
		channels:       u32,
		channelMap:     [^]channel,
		channelMixMode: channel_mix_mode,
		shareMode:      share_mode,
	},
	wasapi:                    struct {
		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,
	},
	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,
	},
	aaudio:                    struct {
		usage:                   aaudio_usage,
		contentType:             aaudio_content_type,
		inputPreset:             aaudio_input_preset,
		noAutoStartAfterReroute: b32,
	},
}

device_data_proc ¶

device_data_proc :: proc "cdecl" (pDevice: ^device, pOutput, pInput: rawptr, frameCount: u32)
 

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.

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,
}

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,
	},
}

device_job_thread ¶

device_job_thread :: struct {
	thread:     thread,
	jobQueue:   job_queue,
	_hasThread: b32,
}

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.

device_notification ¶

device_notification :: struct {
	pDevice: ^device,
	type:    device_notification_type,
	data:    struct #raw_union {
		started:      struct {
			_unused: i32,
		},
		stopped:      struct {
			_unused: i32,
		},
		rerouted:     struct {
			_unused: i32,
		},
		interruption: struct {
			_unused: i32,
		},
	},
}

device_notification_proc ¶

device_notification_proc :: proc "cdecl" (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, 
}
 

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.
}

device_type ¶

device_type :: enum i32 {
	playback = 1, 
	capture  = 2, 
	duplex   = 3, // playback | capture
	loopback = 4, 
}

dither_mode ¶

dither_mode :: enum i32 {
	none      = 0, 
	rectangle, 
	triangle, 
}

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.

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,
	// <-- The drwav/drflac/stb_vorbis/etc. objects. 
	data:             struct {
		vfs: struct {
			pVFS: ^vfs,
			file: vfs_file,
		},
	},
}

encoder_config ¶

encoder_config :: struct {
	encodingFormat:      encoding_format,
	format:              format,
	channels:            u32,
	sampleRate:          u32,
	allocationCallbacks: allocation_callbacks,
}

encoder_init_proc ¶

encoder_init_proc :: proc "cdecl" (pEncoder: ^encoder) -> result

encoder_seek_proc ¶

encoder_seek_proc :: proc "cdecl" (pEncoder: ^encoder, offset: i64, origin: seek_origin) -> result

encoder_uninit_proc ¶

encoder_uninit_proc :: proc "cdecl" (pEncoder: ^encoder)

encoder_write_pcm_frames_proc ¶

encoder_write_pcm_frames_proc :: proc "cdecl" (pEncoder: ^encoder, pFramesIn: rawptr, frameCount: u64, pFramesWritten: ^u64) -> result

encoder_write_proc ¶

encoder_write_proc :: proc "cdecl" (pEncoder: ^encoder, pBufferIn: rawptr, bytesToWrite: uint, pBytesWritten: ^uint) -> result

encoding_format ¶

encoding_format :: enum i32 {
	unknown = 0, 
	wav, 
	flac, 
	mp3, 
	vorbis, 
}

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. 
	monoExpansionMode:      mono_expansion_mode,
}

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. 
	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. 
	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,
}

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. 
	fader:                    fader,
	resampler:                linear_resampler,
	// For pitch shift. 
	spatializer:              spatializer,
	panner:                   panner,
	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,
	// Memory management. 
	_ownsHeap:                b8,
	_pHeap:                   rawptr,
}
 

Base node object for both ma_sound and ma_sound_group.

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. 
	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,
}

engine_node_type ¶

engine_node_type :: enum i32 {
	sound, 
	group, 
}

enum_devices_callback_proc ¶

enum_devices_callback_proc :: proc "cdecl" (pContext: ^context_type, deviceType: device_type, pInfo: ^device_info, pUserData: rawptr) -> b32
 

The callback for handling device enumeration. This is fired from ma_context_enumerated_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()`.

event ¶

event :: distinct rawptr

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: u64,
}

fader_config ¶

fader_config :: struct {
	format:     format,
	channels:   u32,
	sampleRate: u32,
}
 

Fader.

fence ¶

fence :: struct {
	e:       event,
	counter: struct($Key: typeid, $Value: typeid) where intrinsics.type_is_valid_map_key(Key) {},
}
 

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.

file_info ¶

file_info :: struct {
	sizeInBytes: u64,
}

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, 
}

gainer ¶

gainer :: struct {
	config:    gainer_config,
	t:         u32,
	pOldGains: [^]f32,
	pNewGains: [^]f32,
	// Memory management. 
	_pHeap:    rawptr,
	_ownsHeap: b32,
}

gainer_config ¶

gainer_config :: struct {
	channels:           u32,
	smoothTimeInFrames: u32,
}
 

Gainer for smooth volume changes.

handedness ¶

handedness :: enum i32 {
	right, 
	left, 
}

handle ¶

handle :: distinct rawptr

hishelf2 ¶

hishelf2 :: struct {
	bq: biquad,
}

hishelf_config ¶

hishelf_config :: struct {
	format:     format,
	channels:   u32,
	sampleRate: u32,
	gainDB:     f64,
	shelfSlope: f64,
	frequency:  f64,
}
 

*************************************************************************************************************************************************************

High Shelf Filter

*************************************************************************************************************************************************************

hishelf_node ¶

hishelf_node :: struct {
	baseNode: node_base,
	hishelf:  hishelf2,
}

hishelf_node_config ¶

hishelf_node_config :: struct {
	nodeConfig: node_config,
	hishelf:    hishelf_config,
}
 

High Shelf Filter Node

hpf ¶

hpf :: struct {
	format:     format,
	channels:   u32,
	sampleRate: u32,
	hpf1Count:  u32,
	hpf2Count:  u32,
	pHPF1:      ^hpf1,
	pHPF2:      ^hpf2,
	// Memory management. 
	_pHeap:     rawptr,
	_ownsHeap:  b32,
}

hpf1 ¶

hpf1 :: struct {
	format:    format,
	channels:  u32,
	a:         biquad_coefficient,
	pR1:       ^biquad_coefficient,
	// Memory management. 
	_pHeap:    rawptr,
	_ownsHeap: b32,
}

hpf1_config ¶

hpf1_config :: struct {
	format:          format,
	channels:        u32,
	sampleRate:      u32,
	cutoffFrequency: f64,
	q:               f64,
}
 

*************************************************************************************************************************************************************

High-Pass Filtering

*************************************************************************************************************************************************************

hpf2 ¶

hpf2 :: struct {
	bq: biquad,
}

hpf_config ¶

hpf_config :: struct {
	format:          format,
	channels:        u32,
	sampleRate:      u32,
	cutoffFrequency: f64,
	order:           u32,
}

hpf_node ¶

hpf_node :: struct {
	baseNode: node_base,
	hpf:      hpf,
}

hpf_node_config ¶

hpf_node_config :: struct {
	nodeConfig: node_config,
	hpf:        hpf_config,
}
 

High Pass Filter Node

ios_session_category ¶

ios_session_category :: enum i32 {
	default         = 0, // AVAudioSessionCategoryPlayAndRecord with AVAudioSessionCategoryOptionDefaultToSpeaker.
	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,
				},
			},
		},
	},
}

job_proc ¶

job_proc :: proc "cdecl" (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,
}

job_queue_config ¶

job_queue_config :: struct {
	flags:    u32,
	capacity: u32,
}

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.

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.

lcg ¶

lcg :: struct {
	state: i32,
}

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,
}

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

*************************************************************************************************************************************************************

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,
}

log_callback ¶

log_callback :: struct {
	onLog:     log_callback_proc,
	pUserData: rawptr,
}

log_callback_proc ¶

log_callback_proc :: proc "cdecl" (pUserData: rawptr, level: u32, pMessage: cstring)
 

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.

Remarks ------- Do not modify the state of the device from inside the callback.

log_level ¶

log_level :: enum i32 {
	LOG_LEVEL_DEBUG   = 4, 
	LOG_LEVEL_INFO    = 3, 
	LOG_LEVEL_WARNING = 2, 
	LOG_LEVEL_ERROR   = 1, 
}

loshelf2 ¶

loshelf2 :: struct {
	bq: biquad,
}

loshelf_config ¶

loshelf_config :: struct {
	format:     format,
	channels:   u32,
	sampleRate: u32,
	gainDB:     f64,
	shelfSlope: f64,
	frequency:  f64,
}
 

*************************************************************************************************************************************************************

Low Shelf Filter

*************************************************************************************************************************************************************

loshelf_node ¶

loshelf_node :: struct {
	baseNode: node_base,
	loshelf:  loshelf2,
}

loshelf_node_config ¶

loshelf_node_config :: struct {
	nodeConfig: node_config,
	loshelf:    loshelf_config,
}
 

Low Shelf Filter Node

lpf ¶

lpf :: struct {
	format:     format,
	channels:   u32,
	sampleRate: u32,
	lpf1Count:  u32,
	lpf2Count:  u32,
	pLPF1:      ^lpf1,
	pLPF2:      ^lpf2,
	// Memory management. 
	_pHeap:     rawptr,
	_ownsHeap:  b32,
}

lpf1 ¶

lpf1 :: struct {
	format:    format,
	channels:  u32,
	a:         biquad_coefficient,
	pR1:       ^biquad_coefficient,
	// Memory management. 
	_pHeap:    rawptr,
	_ownsHeap: b32,
}

lpf1_config ¶

lpf1_config :: struct {
	format:          format,
	channels:        u32,
	sampleRate:      u32,
	cutoffFrequency: f64,
	q:               f64,
}
 

*************************************************************************************************************************************************************

Low-Pass Filtering

*************************************************************************************************************************************************************

lpf2 ¶

lpf2 :: struct {
	bq: biquad,
}

lpf_config ¶

lpf_config :: struct {
	format:          format,
	channels:        u32,
	sampleRate:      u32,
	cutoffFrequency: f64,
	order:           u32,
}

lpf_node ¶

lpf_node :: struct {
	baseNode: node_base,
	lpf:      lpf,
}

lpf_node_config ¶

lpf_node_config :: struct {
	nodeConfig: node_config,
	lpf:        lpf_config,
}
 

Low Pass Filter Node

ma_read_proc ¶

ma_read_proc :: proc "cdecl" (pUserData: rawptr, pBufferOut: rawptr, bytesToRead: uint, pBytesRead: ^uint) -> result

ma_seek_proc ¶

ma_seek_proc :: proc "cdecl" (pUserData: rawptr, offset: i64, origin: seek_origin) -> result

ma_tell_proc ¶

ma_tell_proc :: proc "cdecl" (pUserData: rawptr, pCursor: ^i64) -> 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, 
}

mutex ¶

mutex :: distinct rawptr

node ¶

node :: struct($Key: typeid, $Value: typeid) where intrinsics.type_is_valid_map_key(Key) {}

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,
}

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,
}

node_graph_config ¶

node_graph_config :: struct {
	channels:             u32,
	nodeCacheCapInFrames: u16,
}

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,
	// atomic
	// The index of the input bus on the input. Required for detaching. 
	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.

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 seperate 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 "cdecl" (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 "cdecl" (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_vtable,
	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,
}

noise_config ¶

noise_config :: struct {
	format:            format,
	channels:          u32,
	type:              noise_type,
	seed:              i32,
	amplitude:         f64,
	duplicateChannels: b32,
}

noise_type ¶

noise_type :: enum i32 {
	white, 
	pink, 
	brownian, 
}

notch2 ¶

notch2 :: struct {
	bq: biquad,
}

notch_config ¶

notch_config :: struct {
	format:     format,
	channels:   u32,
	sampleRate: u32,
	q:          f64,
	frequency:  f64,
}
 

*************************************************************************************************************************************************************

Notching Filter

*************************************************************************************************************************************************************

notch_node ¶

notch_node :: struct {
	baseNode: node_base,
	notch:    notch2,
}

notch_node_config ¶

notch_node_config :: struct {
	nodeConfig: node_config,
	notch:      notch_config,
}
 

Notching Filter Node

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,
}

paged_audio_buffer_config ¶

paged_audio_buffer_config :: struct {
	pData: ^paged_audio_buffer_data,
}

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,
}

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.

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.

panner ¶

panner :: struct {
	format:   format,
	channels: u32,
	mode:     pan_mode,
	pan:      f32,
}

panner_config ¶

panner_config :: struct {
	format:   format,
	channels: u32,
	mode:     pan_mode,
	pan:      f32,
}

pcm_rb ¶

pcm_rb :: struct {
	rb:       rb,
	format:   format,
	channels: u32,
}

peak2 ¶

peak2 :: struct {
	bq: biquad,
}

peak_config ¶

peak_config :: struct {
	format:     format,
	channels:   u32,
	sampleRate: u32,
	gainDB:     f64,
	q:          f64,
	frequency:  f64,
}
 

*************************************************************************************************************************************************************

Peaking EQ Filter

*************************************************************************************************************************************************************

peak_node ¶

peak_node :: struct {
	baseNode: node_base,
	peak:     peak2,
}

peak_node_config ¶

peak_node_config :: struct {
	nodeConfig: node_config,
	peak:       peak_config,
}
 

Peaking Filter Node

performance_profile ¶

performance_profile :: enum i32 {
	low_latency  = 0, 
	conservative, 
}

positioning ¶

positioning :: enum i32 {
	absolute, 
	relative, 
}

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

***********************************************************************************************************************************************************

resample_algorithm ¶

resample_algorithm :: enum int {
	linear = 0, // Fastest, lowest quality. Optional low-pass filtering. Default.
	custom, 
}

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,
}

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,
	},
}

resampling_backend ¶

resampling_backend :: struct($Key: typeid, $Value: typeid) where intrinsics.type_is_valid_map_key(Key) {}

resampling_backend_vtable ¶

resampling_backend_vtable :: struct {
	onGetHeapSize:                 proc "cdecl" (pUserData: rawptr, pConfig: ^resampler_config, pHeapSizeInBytes: ^uint) -> result,
	onInit:                        proc "cdecl" (pUserData: rawptr, pConfig: ^resampler_config, pHeap: rawptr, ppBackend: ^^resampling_backend) -> result,
	onUninit:                      proc "cdecl" (pUserData: rawptr, pBackend: ^resampling_backend, pAllocationCallbacks: ^allocation_callbacks),
	onProcess:                     proc "cdecl" (pUserData: rawptr, pBackend: ^resampling_backend, pFramesIn: rawptr, pFrameCountIn: ^u64, pFramesOut: rawptr, pFrameCountOut: ^u64) -> result,
	onSetRate:                     proc "cdecl" (pUserData: rawptr, pBackend: ^resampling_backend, sampleRateIn: u32, sampleRateOut: u32) -> result,
	// Optional. Rate changes will be disabled. 
	onGetInputLatency:             proc "cdecl" (pUserData: rawptr, pBackend: ^resampling_backend) -> u64,
	// Optional. Latency will be reported as 0. 
	onGetOutputLatency:            proc "cdecl" (pUserData: rawptr, pBackend: ^resampling_backend) -> u64,
	// Optional. Latency will be reported as 0. 
	onGetRequiredInputFrameCount:  proc "cdecl" (pUserData: rawptr, pBackend: ^resampling_backend, outputFrameCount: u64, pInputFrameCount: ^u64) -> result,
	// Optional. Latency mitigation will be disabled. 
	onGetExpectedOutputFrameCount: proc "cdecl" (pUserData: rawptr, pBackend: ^resampling_backend, outputFrameCount: u64, pInputFrameCount: ^u64) -> result,
	// Optional. Latency mitigation will be disabled. 
	onReset:                       proc "cdecl" (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,
}

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. 
	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,
}

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,
	},
}

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,
}

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,
}

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,
}

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,
}

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 miniaudio-specific errors. 
	FORMAT_NOT_SUPPORTED           = -100, 
	DEVICE_TYPE_NOT_SUPPORTED      = -101, 
	SHARE_MODE_NOT_SUPPORTED       = -102, 
	NO_BACKEND                     = -103, 
	NO_DEVICE                      = -104, 
	API_NOT_FOUND                  = -105, 
	INVALID_DEVICE_CONFIG          = -106, 
	LOOP                           = -107, 
	// State errors. 
	DEVICE_NOT_INITIALIZED         = -200, 
	DEVICE_ALREADY_INITIALIZED     = -201, 
	DEVICE_NOT_STARTED             = -202, 
	DEVICE_NOT_STOPPED             = -203, 
	// Operation errors. 
	FAILED_TO_INIT_BACKEND         = -300, 
	FAILED_TO_OPEN_BACKEND_DEVICE  = -301, 
	FAILED_TO_START_BACKEND_DEVICE = -302, 
	FAILED_TO_STOP_BACKEND_DEVICE  = -303, 
}

seek_origin ¶

seek_origin :: enum i32 {
	start, 
	current, 
	end,     // Not used by decoders.
}

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,
}

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      |
	+-----------------+-----------------+

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
	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,
}

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). 
	flags:                          u32,
	// A combination of MA_SOUND_FLAG_* flags. 
	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,
	pDoneFence:                     ^fence,
}

sound_flags ¶

sound_flags :: enum i32 {
	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
	NO_DEFAULT_ATTACHMENT = 16, // Do not attach to the endpoint by default. Useful for when setting up nodes in a complex graph system.
	NO_PITCH              = 32, // Disable pitch shifting with ma_sound_set_pitch() and ma_sound_group_set_pitch(). This is an optimization.
	NO_SPATIALIZATION     = 64, // 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
	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,
}

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). 
	flags:                          u32,
	// A combination of MA_SOUND_FLAG_* flags. 
	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,
	pDoneFence:                     ^fence,
}
 

A sound group is just a sound.

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:                     vec3f,
	direction:                    vec3f,
	velocity:                     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. 
	gainer:                       gainer,
	// For smooth gain transitions. 
	pNewChannelGainsOut:          [^]f32,
	// Memory management. 
	_pHeap:                       rawptr,
	_ownsHeap:                    b32,
}

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. 
	gainSmoothTimeInFrames:       u32,
}

spatializer_listener ¶

spatializer_listener :: struct {
	config:    spatializer_listener_config,
	position:  vec3f,
	// The absolute position of the listener. 
	direction: vec3f,
	// The direction the listener is facing. The world up vector is config.worldUp. 
	velocity:  vec3f,
	isEnabled: b32,
	// Memory management. 
	_ownsHeap: b32,
	_pHeap:    rawptr,
}

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,
}

spinlock ¶

spinlock :: distinct u32
 

Spinlocks are 32-bit for compatibility reasons.

splitter_node ¶

splitter_node :: struct {
	base: node_base,
}

splitter_node_config ¶

splitter_node_config :: struct {
	nodeConfig: node_config,
	channels:   u32,
}
 

Splitter Node. 1 input, 2 outputs. Used for splitting/copying a stream so it can be as input into two separate output nodes.

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, 
}

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  = 11250, 
	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 "cdecl" (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 occuring.

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 ¶

thread :: distinct rawptr

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.

timer ¶

timer :: struct #raw_union {
	counter:  i64,
	counterD: f64,
}

vec3f ¶

vec3f :: struct {
	x: f32,
	y: f32,
	z: f32,
}
 

Spatializer.

vfs ¶

vfs :: struct($Key: typeid, $Value: typeid) where intrinsics.type_is_valid_map_key(Key) {}
 

***********************************************************************************************************************************************************

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.

***********************************************************************************************************************************************************

vfs_callbacks ¶

vfs_callbacks :: struct {
	onOpen:  proc "cdecl" (pVFS: ^vfs, pFilePath: cstring, openMode: u32, pFile: ^vfs_file) -> result,
	onOpenW: proc "cdecl" (pVFS: ^vfs, pFilePath: [^]u16, openMode: u32, pFile: ^vfs_file) -> result,
	onClose: proc "cdecl" (pVFS: ^vfs, file: vfs_file) -> result,
	onRead:  proc "cdecl" (pVFS: ^vfs, file: vfs_file, pDst: rawptr, sizeInBytes: uint, pBytesRead: ^uint) -> result,
	onWrite: proc "cdecl" (pVFS: ^vfs, file: vfs_file, pDst: rawptr, sizeInBytes: uint, pBytesRead: ^uint) -> result,
	onSeek:  proc "cdecl" (pVFS: ^vfs, file: vfs_file, offset: i64, origin: seek_origin) -> result,
	onTell:  proc "cdecl" (pVFS: ^vfs, file: vfs_file, pCursor: ^i64) -> result,
	onInfo:  proc "cdecl" (pVFS: ^vfs, file: vfs_file, pInfo: ^file_info) -> result,
}

vfs_file ¶

vfs_file :: distinct rawptr

waveform ¶

waveform :: struct {
	ds:      data_source_base,
	config:  waveform_config,
	advance: f64,
	time:    f64,
}

waveform_config ¶

waveform_config :: struct {
	format:     format,
	channels:   u32,
	sampleRate: u32,
	type:       waveform_type,
	amplitude:  f64,
	frequency:  f64,
}

waveform_type ¶

waveform_type :: enum i32 {
	sine, 
	square, 
	triangle, 
	sawtooth, 
}

Constants

BACKEND_COUNT ¶

BACKEND_COUNT :: len(backend)

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

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_BUS_COUNT ¶

MAX_NODE_BUS_COUNT :: 254
 

Must never exceed 254.

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.

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_AAUDIO ¶

SUPPORT_AAUDIO :: false

SUPPORT_ALSA ¶

SUPPORT_ALSA :: ODIN_OS == .Linux

SUPPORT_AUDIO4 ¶

SUPPORT_AUDIO4 :: false

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_NULL ¶

SUPPORT_NULL :: true

SUPPORT_OPENSL ¶

SUPPORT_OPENSL :: false

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_WEBAUDIO ¶

SUPPORT_WEBAUDIO :: false

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 "cdecl" (p: rawptr, pAllocationCallbacks: ^allocation_callbacks) ---
 

Free's an aligned malloc'd buffer.

aligned_malloc ¶

aligned_malloc :: proc "cdecl" (sz, alignment: uint, pAllocationCallbacks: ^allocation_callbacks) -> rawptr ---
 

Performs an aligned malloc, with the assumption that the alignment is a power of 2.

apply_volume_factor_f32 ¶

apply_volume_factor_f32 :: proc "cdecl" (pSamples: [^]f32, sampleCount: u64, factor: f32) ---

apply_volume_factor_pcm_frames ¶

apply_volume_factor_pcm_frames :: proc "cdecl" (pFrames: rawptr, frameCount: u64, format: format, channels: u32, factor: f32) ---

apply_volume_factor_pcm_frames_f32 ¶

apply_volume_factor_pcm_frames_f32 :: proc "cdecl" (pFrames: [^]f32, frameCount: u64, channels: u32, factor: f32) ---

apply_volume_factor_pcm_frames_s16 ¶

apply_volume_factor_pcm_frames_s16 :: proc "cdecl" (pFrames: [^]i16, frameCount: u64, channels: u32, factor: f32) ---

apply_volume_factor_pcm_frames_s24 ¶

apply_volume_factor_pcm_frames_s24 :: proc "cdecl" (pFrames: rawptr, frameCount: u64, channels: u32, factor: f32) ---

apply_volume_factor_pcm_frames_s32 ¶

apply_volume_factor_pcm_frames_s32 :: proc "cdecl" (pFrames: [^]i32, frameCount: u64, channels: u32, factor: f32) ---

apply_volume_factor_pcm_frames_u8 ¶

apply_volume_factor_pcm_frames_u8 :: proc "cdecl" (pFrames: [^]u8, frameCount: u64, channels: u32, factor: f32) ---

apply_volume_factor_s16 ¶

apply_volume_factor_s16 :: proc "cdecl" (pSamples: [^]i16, sampleCount: u64, factor: f32) ---

apply_volume_factor_s24 ¶

apply_volume_factor_s24 :: proc "cdecl" (pSamples: rawptr, sampleCount: u64, factor: f32) ---

apply_volume_factor_s32 ¶

apply_volume_factor_s32 :: proc "cdecl" (pSamples: [^]i32, sampleCount: u64, factor: f32) ---

apply_volume_factor_u8 ¶

apply_volume_factor_u8 :: proc "cdecl" (pSamples: [^]u8, sampleCount: u64, factor: f32) ---

async_notification_event_init ¶

async_notification_event_init :: proc "cdecl" (pNotificationEvent: ^async_notification_event) -> result ---

async_notification_event_signal ¶

async_notification_event_signal :: proc "cdecl" (pNotificationEvent: ^async_notification_event) -> result ---

async_notification_event_uninit ¶

async_notification_event_uninit :: proc "cdecl" (pNotificationEvent: ^async_notification_event) -> result ---

async_notification_event_wait ¶

async_notification_event_wait :: proc "cdecl" (pNotificationEvent: ^async_notification_event) -> result ---

async_notification_poll_init ¶

async_notification_poll_init :: proc "cdecl" (pNotificationPoll: ^async_notification_poll) -> result ---

async_notification_poll_is_signalled ¶

async_notification_poll_is_signalled :: proc "cdecl" (pNotificationPoll: ^async_notification_poll) -> b32 ---

async_notification_signal ¶

async_notification_signal :: proc "cdecl" (pNotification: ^async_notification) -> result ---

audio_buffer_alloc_and_init ¶

audio_buffer_alloc_and_init :: proc "cdecl" (pConfig: ^audio_buffer_config, ppAudioBuffer: ^^audio_buffer) -> result ---

audio_buffer_at_end ¶

audio_buffer_at_end :: proc "cdecl" (pAudioBuffer: ^audio_buffer) -> b32 ---

audio_buffer_config_init ¶

audio_buffer_config_init :: proc "cdecl" (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 "cdecl" (pAudioBuffer: ^audio_buffer, pCursor: ^u64) -> result ---

audio_buffer_get_cursor_in_pcm_frames ¶

audio_buffer_get_cursor_in_pcm_frames :: proc "cdecl" (pAudioBuffer: ^audio_buffer, pCursor: ^u64) -> result ---

audio_buffer_get_length_in_pcm_frames ¶

audio_buffer_get_length_in_pcm_frames :: proc "cdecl" (pAudioBuffer: ^audio_buffer, pCursor: ^u64) -> result ---

audio_buffer_init ¶

audio_buffer_init :: proc "cdecl" (pConfig: ^audio_buffer_config, pAudioBuffer: ^audio_buffer) -> result ---

audio_buffer_init_copy ¶

audio_buffer_init_copy :: proc "cdecl" (pConfig: ^audio_buffer_config, pAudioBuffer: ^audio_buffer) -> result ---

audio_buffer_map ¶

audio_buffer_map :: proc "cdecl" (pAudioBuffer: ^audio_buffer, ppFramesOut: ^rawptr, pFrameCount: ^u64) -> result ---

audio_buffer_read_pcm_frames ¶

audio_buffer_read_pcm_frames :: proc "cdecl" (pAudioBuffer: ^audio_buffer, pFramesOut: rawptr, frameCount: u64, loop: b32) -> u64 ---

audio_buffer_ref_at_end ¶

audio_buffer_ref_at_end :: proc "cdecl" (pAudioBufferRef: ^audio_buffer_ref) -> b32 ---

audio_buffer_ref_get_available_frames ¶

audio_buffer_ref_get_available_frames :: proc "cdecl" (pAudioBufferRef: ^audio_buffer_ref, pCursor: ^u64) -> result ---

audio_buffer_ref_get_cursor_in_pcm_frames ¶

audio_buffer_ref_get_cursor_in_pcm_frames :: proc "cdecl" (pAudioBufferRef: ^audio_buffer_ref, pCursor: ^u64) -> result ---

audio_buffer_ref_get_length_in_pcm_frames ¶

audio_buffer_ref_get_length_in_pcm_frames :: proc "cdecl" (pAudioBufferRef: ^audio_buffer_ref, pCursor: ^u64) -> result ---

audio_buffer_ref_init ¶

audio_buffer_ref_init :: proc "cdecl" (format: format, channels: u32, pData: rawptr, sizeInFrames: u64, pAudioBufferRef: ^audio_buffer_ref) -> result ---

audio_buffer_ref_map ¶

audio_buffer_ref_map :: proc "cdecl" (pAudioBufferRef: ^audio_buffer_ref, ppFramesOut: ^rawptr, pFrameCount: ^u64) -> result ---

audio_buffer_ref_read_pcm_frames ¶

audio_buffer_ref_read_pcm_frames :: proc "cdecl" (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 "cdecl" (pAudioBufferRef: ^audio_buffer_ref, frameIndex: u64) -> result ---

audio_buffer_ref_set_data ¶

audio_buffer_ref_set_data :: proc "cdecl" (pAudioBufferRef: ^audio_buffer_ref, pData: rawptr, sizeInFrames: u64) -> result ---

audio_buffer_ref_uninit ¶

audio_buffer_ref_uninit :: proc "cdecl" (pAudioBufferRef: ^audio_buffer_ref) ---

audio_buffer_ref_unmap ¶

audio_buffer_ref_unmap :: proc "cdecl" (pAudioBufferRef: ^audio_buffer_ref, frameIndex: u64) -> result ---

audio_buffer_seek_to_pcm_frame ¶

audio_buffer_seek_to_pcm_frame :: proc "cdecl" (pAudioBuffer: ^audio_buffer, frameIndex: u64) -> result ---

audio_buffer_uninit ¶

audio_buffer_uninit :: proc "cdecl" (pAudioBuffer: ^audio_buffer) ---

audio_buffer_uninit_and_free ¶

audio_buffer_uninit_and_free :: proc "cdecl" (pAudioBuffer: ^audio_buffer) ---

audio_buffer_unmap ¶

audio_buffer_unmap :: proc "cdecl" (pAudioBuffer: ^audio_buffer, frameIndex: u64) -> result ---

biquad_clear_cache ¶

biquad_clear_cache :: proc "cdecl" (pBQ: ^biquad) -> result ---

biquad_config_init ¶

biquad_config_init :: proc "cdecl" (
	format:             format, 
	channels:           u32, 
	b0, b1, b2, a0, a1, 
) -> biquad_config ---

biquad_get_heap_size ¶

biquad_get_heap_size :: proc "cdecl" (pConfig: ^biquad_config, pHeapSizeInBytes: ^uint) -> result ---

biquad_get_latency ¶

biquad_get_latency :: proc "cdecl" (pBQ: ^biquad) -> u32 ---

biquad_init ¶

biquad_init :: proc "cdecl" (pConfig: ^biquad_config, pAllocationCallbacks: ^allocation_callbacks, pBQ: ^biquad) -> result ---

biquad_init_preallocated ¶

biquad_init_preallocated :: proc "cdecl" (pConfig: ^biquad_config, pHeap: rawptr, pBQ: ^biquad) -> result ---

biquad_node_config_init ¶

biquad_node_config_init :: proc "cdecl" (
	channels:           u32, 
	b0, b1, b2, a0, a1, 
) -> biquad_node_config ---

biquad_node_init ¶

biquad_node_init :: proc "cdecl" (pNodeGraph: ^node_graph, pConfig: ^biquad_node_config, pAllocationCallbacks: ^allocation_callbacks, pNode: ^biquad_node) -> result ---

biquad_node_reinit ¶

biquad_node_reinit :: proc "cdecl" (pConfig: ^biquad_config, pNode: ^biquad_node) -> result ---

biquad_node_uninit ¶

biquad_node_uninit :: proc "cdecl" (pNode: ^biquad_node, pAllocationCallbacks: ^allocation_callbacks) ---

biquad_process_pcm_frames ¶

biquad_process_pcm_frames :: proc "cdecl" (pBQ: ^biquad, pFramesOut, pFramesIn: rawptr, frameCount: u64) -> result ---

biquad_reinit ¶

biquad_reinit :: proc "cdecl" (pConfig: ^biquad_config, pBQ: ^biquad) -> result ---

biquad_uninit ¶

biquad_uninit :: proc "cdecl" (pBQ: ^biquad, pAllocationCallbacks: ^allocation_callbacks) ---

blend_f32 ¶

blend_f32 :: proc "cdecl" (pOut, pInA, pInB: [^]f32, factor: f32, channels: u32) ---
 

Blends two frames in floating point format.

bpf2_config_init ¶

bpf2_config_init :: proc "cdecl" (format: format, channels: u32, sampleRate: u32, cutoffFrequency, q: f64) -> bpf2_config ---

bpf2_get_heap_size ¶

bpf2_get_heap_size :: proc "cdecl" (pConfig: ^bpf2_config, pHeapSizeInBytes: ^uint) -> result ---

bpf2_get_latency ¶

bpf2_get_latency :: proc "cdecl" (pBPF: ^bpf2) -> u32 ---

bpf2_init ¶

bpf2_init :: proc "cdecl" (pConfig: ^bpf2_config, pAllocationCallbacks: ^allocation_callbacks, pBPF: ^bpf2) -> result ---

bpf2_init_preallocated ¶

bpf2_init_preallocated :: proc "cdecl" (pConfig: ^bpf2_config, pHeap: rawptr, pBPF: ^bpf2) -> result ---

bpf2_process_pcm_frames ¶

bpf2_process_pcm_frames :: proc "cdecl" (pBPF: ^bpf2, pFramesOut: rawptr, pFramesIn: rawptr, frameCount: u64) -> result ---

bpf2_reinit ¶

bpf2_reinit :: proc "cdecl" (pConfig: ^bpf2_config, pBPF: ^bpf2) -> result ---

bpf2_uninit ¶

bpf2_uninit :: proc "cdecl" (pBPF: ^bpf2, pAllocationCallbacks: ^allocation_callbacks) ---

bpf_config_init ¶

bpf_config_init :: proc "cdecl" (format: format, channels: u32, sampleRate: u32, cutoffFrequency: f64, order: u32) -> bpf_config ---

bpf_get_heap_size ¶

bpf_get_heap_size :: proc "cdecl" (pConfig: ^bpf_config, pHeapSizeInBytes: ^uint) -> result ---

bpf_get_latency ¶

bpf_get_latency :: proc "cdecl" (pBPF: ^bpf) -> u32 ---

bpf_init ¶

bpf_init :: proc "cdecl" (pConfig: ^bpf_config, pAllocationCallbacks: ^allocation_callbacks, pBPF: ^bpf) -> result ---

bpf_init_preallocated ¶

bpf_init_preallocated :: proc "cdecl" (pConfig: ^bpf_config, pHeap: rawptr, pBPF: ^bpf) -> result ---

bpf_node_config_init ¶

bpf_node_config_init :: proc "cdecl" (channels, sampleRate: u32, cutoffFrequency: f64, order: u32) -> bpf_node_config ---

bpf_node_init ¶

bpf_node_init :: proc "cdecl" (pNodeGraph: ^node_graph, pConfig: ^bpf_node_config, pAllocationCallbacks: ^allocation_callbacks, pNode: ^bpf_node) -> result ---

bpf_node_reinit ¶

bpf_node_reinit :: proc "cdecl" (pConfig: ^bpf_config, pNode: ^bpf_node) -> result ---

bpf_node_uninit ¶

bpf_node_uninit :: proc "cdecl" (pNode: ^bpf_node, pAllocationCallbacks: ^allocation_callbacks) ---

bpf_process_pcm_frames ¶

bpf_process_pcm_frames :: proc "cdecl" (pBPF: ^bpf, pFramesOut: rawptr, pFramesIn: rawptr, frameCount: u64) -> result ---

bpf_reinit ¶

bpf_reinit :: proc "cdecl" (pConfig: ^bpf_config, pBPF: ^bpf) -> result ---

bpf_uninit ¶

bpf_uninit :: proc "cdecl" (pBPF: ^bpf, pAllocationCallbacks: ^allocation_callbacks) ---

calculate_buffer_size_in_frames_from_descriptor ¶

calculate_buffer_size_in_frames_from_descriptor :: proc "cdecl" (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 "cdecl" (x, y: 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 "cdecl" (x, y: u32) -> u32 ---
 

Calculates a buffer size in milliseconds from the specified number of frames and sample rate.

calloc ¶

calloc :: proc "cdecl" (sz: uint, pAllocationCallbacks: ^allocation_callbacks) -> rawptr ---
 

calloc()

channel_converter_config_init ¶

channel_converter_config_init :: proc "cdecl" (
	format:         format, 
	channelsIn:     u32, 
	pChannelMapIn:  [^]channel, 
	channelsOut:    u32, 
	pChannelMapOut: [^]channel, 
) -> channel_converter_config ---

channel_converter_get_heap_size ¶

channel_converter_get_heap_size :: proc "cdecl" (pConfig: ^channel_converter_config, pHeapSizeInBytes: ^uint) -> result ---

channel_converter_get_input_channel_map ¶

channel_converter_get_input_channel_map :: proc "cdecl" (pConverter: ^channel_converter, pChannelMap: [^]channel, channelMapCap: uint) -> result ---

channel_converter_get_output_channel_map ¶

channel_converter_get_output_channel_map :: proc "cdecl" (pConverter: ^channel_converter, pChannelMap: [^]channel, channelMapCap: uint) -> result ---

channel_converter_init ¶

channel_converter_init :: proc "cdecl" (pConfig: ^channel_converter_config, pAllocationCallbacks: ^allocation_callbacks, pConverter: ^channel_converter) -> result ---

channel_converter_init_preallocated ¶

channel_converter_init_preallocated :: proc "cdecl" (pConfig: ^channel_converter_config, pHeap: rawptr, pConverter: ^channel_converter) -> result ---

channel_converter_process_pcm_frames ¶

channel_converter_process_pcm_frames :: proc "cdecl" (pConverter: ^channel_converter, pFramesOut, pFramesIn: rawptr, frameCount: u64) -> result ---

channel_converter_uninit ¶

channel_converter_uninit :: proc "cdecl" (pConverter: ^channel_converter, pAllocationCallbacks: ^allocation_callbacks) ---

channel_map_contains_channel_position ¶

channel_map_contains_channel_position :: proc "cdecl" (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 ¶

channel_map_copy :: proc "cdecl" (pOut: [^]channel, pIn: [^]channel, channels: u32) ---
 

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 "cdecl" (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_get_channel ¶

channel_map_get_channel :: proc "cdecl" (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 ¶

channel_map_init_blank :: proc "cdecl" (pChannelMap: [^]channel, channels: u32) ---
 

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 "cdecl" (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 ¶

channel_map_is_blank :: proc "cdecl" (pChannelMap: [^]channel, channels: u32) -> b32 ---
 

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 ¶

channel_map_is_equal :: proc "cdecl" (pChannelMapA, pChannelMapB: [^]channel, channels: u32) -> b32 ---
 

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 ¶

channel_map_is_valid :: proc "cdecl" (pChannelMap: [^]channel, channels: u32) -> b32 ---
 

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`.

clip_pcm_frames ¶

clip_pcm_frames :: proc "cdecl" (dst: rawptr, src: rawptr, frameCount: u64, format: format, channels: u32) ---

clip_samples_f32 ¶

clip_samples_f32 :: proc "cdecl" (pDst, pSrc: [^]f32, count: u64) ---

clip_samples_s16 ¶

clip_samples_s16 :: proc "cdecl" (pDst: [^]i16, pSrc: [^]i32, count: u64) ---

clip_samples_s24 ¶

clip_samples_s24 :: proc "cdecl" (pDst: [^]u8, pSrc: [^]i64, count: u64) ---

clip_samples_s32 ¶

clip_samples_s32 :: proc "cdecl" (pDst: [^]i32, pSrc: [^]i64, count: u64) ---

clip_samples_u8 ¶

clip_samples_u8 :: proc "cdecl" (pDst: [^]u8, pSrc: [^]i16, count: u64) ---
 

Clips samples.

context_config_init ¶

context_config_init :: proc "cdecl" () -> 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 "cdecl" (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 "cdecl" (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 "cdecl" (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 "cdecl" (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 "cdecl" (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 "cdecl" (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 "cdecl" () -> 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 "cdecl" (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 "cdecl" (
	pOut:          rawptr, 
	frameCountOut: u64, 
	formatOut:     format, 
	channelsOut:   u32, 
	sampleRateOut: u32, 
	pIn:           rawptr, 
	frameCountIn:  u64, 
	formatIn:      format, 
	channelsIn:    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.

convert_frames_ex ¶

convert_frames_ex :: proc "cdecl" (pOut: rawptr, frameCountOut: u64, pIn: rawptr, frameCountIn: u64, pConfig: ^data_converter_config) -> u64 ---

convert_pcm_frames_format ¶

convert_pcm_frames_format :: proc "cdecl" (
	pOut:       rawptr, 
	formatOut:  format, 
	pIn:        rawptr, 
	formatIn:   format, 
	frameCount: u64, 
	channels:   u32, 
) ---

copy_and_apply_volume_factor_f32 ¶

copy_and_apply_volume_factor_f32 :: proc "cdecl" (pSamplesOut, pSamplesIn: [^]f32, sampleCount: u64, factor: f64) ---

copy_and_apply_volume_factor_pcm_frames ¶

copy_and_apply_volume_factor_pcm_frames :: proc "cdecl" (
	pFramesOut, pFramesIn: rawptr, 
	frameCount:            u64, 
	format:                format, 
	channels:              u32, 
) ---

copy_and_apply_volume_factor_pcm_frames_f32 ¶

copy_and_apply_volume_factor_pcm_frames_f32 :: proc "cdecl" (pPCMFramesOut, pPCMFramesIn: [^]f32, frameCount: u64, channels: u32, factor: f32) ---

copy_and_apply_volume_factor_pcm_frames_s16 ¶

copy_and_apply_volume_factor_pcm_frames_s16 :: proc "cdecl" (pPCMFramesOut, pPCMFramesIn: [^]i16, frameCount: u64, channels: u32, factor: f32) ---

copy_and_apply_volume_factor_pcm_frames_s24 ¶

copy_and_apply_volume_factor_pcm_frames_s24 :: proc "cdecl" (pPCMFramesOut, pPCMFramesIn: rawptr, frameCount: u64, channels: u32, factor: f32) ---

copy_and_apply_volume_factor_pcm_frames_s32 ¶

copy_and_apply_volume_factor_pcm_frames_s32 :: proc "cdecl" (pPCMFramesOut, pPCMFramesIn: [^]i32, frameCount: u64, channels: u32, factor: f32) ---

copy_and_apply_volume_factor_pcm_frames_u8 ¶

copy_and_apply_volume_factor_pcm_frames_u8 :: proc "cdecl" (pPCMFramesOut, pPCMFramesIn: [^]u8, frameCount: u64, channels: u32, factor: f32) ---

copy_and_apply_volume_factor_per_channel_f32 ¶

copy_and_apply_volume_factor_per_channel_f32 :: proc "cdecl" (pFramesOut, pFramesIn: [^]f32, frameCount: u64, channels: u32, pChannelGains: [^]f32) ---

copy_and_apply_volume_factor_s16 ¶

copy_and_apply_volume_factor_s16 :: proc "cdecl" (pSamplesOut, pSamplesIn: [^]i16, sampleCount: u64, factor: f64) ---

copy_and_apply_volume_factor_s24 ¶

copy_and_apply_volume_factor_s24 :: proc "cdecl" (pSamplesOut, pSamplesIn: rawptr, sampleCount: u64, factor: f64) ---

copy_and_apply_volume_factor_s32 ¶

copy_and_apply_volume_factor_s32 :: proc "cdecl" (pSamplesOut, pSamplesIn: [^]i32, sampleCount: u64, factor: f64) ---

copy_and_apply_volume_factor_u8 ¶

copy_and_apply_volume_factor_u8 :: proc "cdecl" (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 "cdecl" (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 "cdecl" (
	formatIn, formatOut:     format, 
	channelsIn, channelsOut: u32, 
	sampleRateIn, 
) -> data_converter_config ---

data_converter_config_init_default ¶

data_converter_config_init_default :: proc "cdecl" () -> data_converter_config ---

data_converter_get_expected_output_frame_count ¶

data_converter_get_expected_output_frame_count :: proc "cdecl" (pConverter: ^data_converter, outputFrameCount: u64, pInputFrameCount: ^u64) -> result ---

data_converter_get_heap_size ¶

data_converter_get_heap_size :: proc "cdecl" (pConfig: ^data_converter_config, pHeapSizeInBytes: ^uint) -> result ---

data_converter_get_input_channel_map ¶

data_converter_get_input_channel_map :: proc "cdecl" (pConverter: ^data_converter, pChannelMap: [^]channel, channelMapCap: uint) -> result ---

data_converter_get_input_latency ¶

data_converter_get_input_latency :: proc "cdecl" (pConverter: ^data_converter) -> u64 ---

data_converter_get_output_channel_map ¶

data_converter_get_output_channel_map :: proc "cdecl" (pConverter: ^data_converter, pChannelMap: [^]channel, channelMapCap: uint) -> result ---

data_converter_get_output_latency ¶

data_converter_get_output_latency :: proc "cdecl" (pConverter: ^data_converter) -> u64 ---

data_converter_get_required_input_frame_count ¶

data_converter_get_required_input_frame_count :: proc "cdecl" (pConverter: ^data_converter, outputFrameCount: u64, pInputFrameCount: ^u64) -> result ---

data_converter_init ¶

data_converter_init :: proc "cdecl" (pConfig: ^data_converter_config, pAllocationCallbacks: ^allocation_callbacks, pConverter: ^data_converter) -> result ---

data_converter_init_preallocated ¶

data_converter_init_preallocated :: proc "cdecl" (pConfig: ^data_converter_config, pHeap: rawptr, pConverter: ^data_converter) -> result ---

data_converter_process_pcm_frames ¶

data_converter_process_pcm_frames :: proc "cdecl" (pConverter: ^data_converter, pFramesIn: rawptr, pFrameCountIn: ^u64, pFramesOut: rawptr, pFrameCountOut: ^u64) -> result ---

data_converter_reset ¶

data_converter_reset :: proc "cdecl" (pConverter: ^data_converter) -> result ---

data_converter_set_rate ¶

data_converter_set_rate :: proc "cdecl" (pConverter: ^data_converter, sampleRateIn, sampleRateOut: u32) -> result ---

data_converter_set_rate_ratio ¶

data_converter_set_rate_ratio :: proc "cdecl" (pConverter: ^data_converter, ratioInOut: f32) -> result ---

data_converter_uninit ¶

data_converter_uninit :: proc "cdecl" (pConverter: ^data_converter, pAllocationCallbacks: ^allocation_callbacks) ---

data_source_config_init ¶

data_source_config_init :: proc "cdecl" () -> data_source_config ---

data_source_get_current ¶

data_source_get_current :: proc "cdecl" (pDataSource: ^data_source) -> ^data_source ---

data_source_get_cursor_in_pcm_frames ¶

data_source_get_cursor_in_pcm_frames :: proc "cdecl" (pDataSource: ^data_source, pCursor: ^u64) -> result ---

data_source_get_cursor_in_seconds ¶

data_source_get_cursor_in_seconds :: proc "cdecl" (pDataSource: ^data_source, pCursor: ^f32) -> result ---

data_source_get_data_format ¶

data_source_get_data_format :: proc "cdecl" (
	pDataSource: ^data_source, 
	pFormat:     ^format, 
	pChannels:   ^u32, 
	pSampleRate: ^u32, 
	pChannelMap: [^]channel, 
) -> result ---

data_source_get_length_in_pcm_frames ¶

data_source_get_length_in_pcm_frames :: proc "cdecl" (pDataSource: ^data_source, pCursor: ^u64) -> result ---

data_source_get_length_in_seconds ¶

data_source_get_length_in_seconds :: proc "cdecl" (pDataSource: ^data_source, pCursor: ^f32) -> result ---

data_source_get_loop_point_in_pcm_frames ¶

data_source_get_loop_point_in_pcm_frames :: proc "cdecl" (pDataSource: ^data_source, pRangeBegInFrames: ^u64, pRangeEndInFrames: ^u64) ---

data_source_get_next ¶

data_source_get_next :: proc "cdecl" (pDataSource: ^data_source) -> ^data_source ---

data_source_get_next_callback ¶

data_source_get_next_callback :: proc "cdecl" (pDataSource: ^data_source) -> ^data_source_get_next_proc ---

data_source_get_range_in_pcm_frames ¶

data_source_get_range_in_pcm_frames :: proc "cdecl" (pDataSource: ^data_source, pRangeBegInFrames: ^u64, pRangeEndInFrames: ^u64) ---

data_source_init ¶

data_source_init :: proc "cdecl" (pConfig: ^data_source_config, pDataSource: ^data_source) -> result ---

data_source_is_looping ¶

data_source_is_looping :: proc "cdecl" (pDataSource: ^data_source) -> b32 ---

data_source_node_config_init ¶

data_source_node_config_init :: proc "cdecl" (pDataSource: ^data_source) -> data_source_node_config ---

data_source_node_init ¶

data_source_node_init :: proc "cdecl" (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 "cdecl" (pDataSourceNode: ^data_source_node) -> b32 ---

data_source_node_set_looping ¶

data_source_node_set_looping :: proc "cdecl" (pDataSourceNode: ^data_source_node, isLooping: b32) -> result ---

data_source_node_uninit ¶

data_source_node_uninit :: proc "cdecl" (pDataSourceNode: ^data_source_node, pAllocationCallbacks: ^allocation_callbacks) ---

data_source_read_pcm_frames ¶

data_source_read_pcm_frames :: proc "cdecl" (pDataSource: ^data_source, pFramesOut: rawptr, frameCount: u64, pFramesRead: ^u64) -> result ---

data_source_seek_pcm_frames ¶

data_source_seek_pcm_frames :: proc "cdecl" (pDataSource: ^data_source, frameCount: u64, pFramesSeeked: ^u64) -> result ---

data_source_seek_to_pcm_frame ¶

data_source_seek_to_pcm_frame :: proc "cdecl" (pDataSource: ^data_source, frameIndex: u64) -> result ---

data_source_set_current ¶

data_source_set_current :: proc "cdecl" (pDataSource: ^data_source, pCurrentDataSource: ^data_source) -> result ---

data_source_set_loop_point_in_pcm_frames ¶

data_source_set_loop_point_in_pcm_frames :: proc "cdecl" (pDataSource: ^data_source, rangeBegInFrames: u64, rangeEndInFrames: u64) -> result ---

data_source_set_looping ¶

data_source_set_looping :: proc "cdecl" (pDataSource: ^data_source, isLooping: b32) -> result ---

data_source_set_next ¶

data_source_set_next :: proc "cdecl" (pDataSource: ^data_source, pCurrentDataSource: ^data_source) -> result ---

data_source_set_next_callback ¶

data_source_set_next_callback :: proc "cdecl" (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 "cdecl" (pDataSource: ^data_source, rangeBegInFrames: u64, rangeEndInFrames: u64) -> result ---

data_source_uninit ¶

data_source_uninit :: proc "cdecl" (pDataSource: ^data_source) ---

decode_file ¶

decode_file :: proc "cdecl" (pFilePath: cstring, pConfig: ^decoder_config, pFrameCountOut: ^u64, ppPCMFramesOut: ^rawptr) -> result ---

decode_from_vfs ¶

decode_from_vfs :: proc "cdecl" (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.

decode_memory ¶

decode_memory :: proc "cdecl" (pData: rawptr, dataSize: uint, pConfig: ^decoder_config, pFrameCountOut: ^u64, ppPCMFramesOut: ^rawptr) -> result ---

decoder_config_init ¶

decoder_config_init :: proc "cdecl" (outputFormat: format, outputChannels, outputSampleRate: u32) -> decoder_config ---

decoder_config_init_default ¶

decoder_config_init_default :: proc "cdecl" () -> decoder_config ---

decoder_get_available_frames ¶

decoder_get_available_frames :: proc "cdecl" (pDecoder: ^decoder, pCursor: ^u64) -> result ---
 

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 ¶

decoder_get_cursor_in_pcm_frames :: proc "cdecl" (pDecoder: ^decoder, pCursor: ^u64) -> result ---
 

Retrieves the current position of the read cursor in PCM frames.

decoder_get_data_format ¶

decoder_get_data_format :: proc "cdecl" (
	pDecoder:               ^decoder, 
	pFormat:                ^format, 
	pChannels, pSampleRate: ^u32, 
	pChannelMap:            ^channel, 
) -> result ---
 

Retrieves the decoder's output data format.

decoder_get_length_in_pcm_frames ¶

decoder_get_length_in_pcm_frames :: proc "cdecl" (pDecoder: ^decoder, pCursor: ^u64) -> result ---
 

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 "cdecl" (onRead: decoder_read_proc, onSeek: decoder_seek_proc, pUserData: rawptr, pConfig: ^decoder_config, pDecoder: ^decoder) -> result ---

decoder_init_file ¶

decoder_init_file :: proc "cdecl" (pFilePath: cstring, pConfig: ^decoder_config, pDecoder: ^decoder) -> result ---

decoder_init_file_w ¶

decoder_init_file_w :: proc "cdecl" (pFilePath: [^]u16, pConfig: ^decoder_config, pDecoder: ^decoder) -> result ---

decoder_init_memory ¶

decoder_init_memory :: proc "cdecl" (pData: rawptr, dataSize: uint, pConfig: ^decoder_config, pDecoder: ^decoder) -> result ---

decoder_init_vfs ¶

decoder_init_vfs :: proc "cdecl" (pVFS: ^vfs, pFilePath: cstring, pConfig: ^decoder_config, pDecoder: ^decoder) -> result ---

decoder_init_vfs_w ¶

decoder_init_vfs_w :: proc "cdecl" (pVFS: ^vfs, pFilePath: [^]u16, pConfig: ^decoder_config, pDecoder: ^decoder) -> result ---

decoder_read_pcm_frames ¶

decoder_read_pcm_frames :: proc "cdecl" (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 ¶

decoder_seek_to_pcm_frame :: proc "cdecl" (pDecoder: ^decoder, frameIndex: u64) -> result ---
 

Seeks to a PCM frame based on it's absolute index.

This is not thread safe without your own synchronization.

decoder_uninit ¶

decoder_uninit :: proc "cdecl" (pDecoder: ^decoder) -> result ---
 

Uninitializes a decoder.

decoding_backend_config_init ¶

decoding_backend_config_init :: proc "cdecl" (preferredFormat: format, seekPointCount: u32) -> decoding_backend_config ---

default_vfs_init ¶

default_vfs_init :: proc "cdecl" (pVFS: ^default_vfs, pAllocationCallbacks: ^allocation_callbacks) -> result ---

deinterleave_pcm_frames ¶

deinterleave_pcm_frames :: proc "cdecl" (format: format, channels: u32, frameCount: u64, pInterleavedPCMFrames: rawptr, ppDeinterleavedPCMFrames: ^rawptr) ---
 

Deinterleaves an interleaved buffer.

delay_config_init ¶

delay_config_init :: proc "cdecl" (channels, sampleRate, delayInFrames: u32, decay: f32) -> delay_config ---

delay_get_decay ¶

delay_get_decay :: proc "cdecl" (pDelay: ^delay) -> f32 ---

delay_get_dry ¶

delay_get_dry :: proc "cdecl" (pDelay: ^delay) -> f32 ---

delay_get_wet ¶

delay_get_wet :: proc "cdecl" (pDelay: ^delay) -> f32 ---

delay_init ¶

delay_init :: proc "cdecl" (pConfig: ^delay_config, pAllocationCallbacks: ^allocation_callbacks, pDelay: ^delay) -> result ---

delay_node_config_init ¶

delay_node_config_init :: proc "cdecl" (channels, sampleRate, delayInFrames: u32, decay: f32) -> delay_node_config ---

delay_node_get_decay ¶

delay_node_get_decay :: proc "cdecl" (pDelayNode: ^delay_node) -> f32 ---

delay_node_get_dry ¶

delay_node_get_dry :: proc "cdecl" (pDelayNode: ^delay_node) -> f32 ---

delay_node_get_wet ¶

delay_node_get_wet :: proc "cdecl" (pDelayNode: ^delay_node) -> f32 ---

delay_node_init ¶

delay_node_init :: proc "cdecl" (pNodeGraph: ^node_graph, pConfig: ^delay_node_config, pAllocationCallbacks: ^allocation_callbacks, pDelayNode: ^delay_node) -> result ---

delay_node_set_decay ¶

delay_node_set_decay :: proc "cdecl" (pDelayNode: ^delay_node, value: f32) ---

delay_node_set_dry ¶

delay_node_set_dry :: proc "cdecl" (pDelayNode: ^delay_node, value: f32) ---

delay_node_set_wet ¶

delay_node_set_wet :: proc "cdecl" (pDelayNode: ^delay_node, value: f32) ---

delay_node_uninit ¶

delay_node_uninit :: proc "cdecl" (pDelayNode: ^delay_node, pAllocationCallbacks: ^allocation_callbacks) ---

delay_process_pcm_frames ¶

delay_process_pcm_frames :: proc "cdecl" (pDelay: ^delay, pFramesOut, pFramesIn: rawptr, frameCount: u32) -> result ---

delay_set_decay ¶

delay_set_decay :: proc "cdecl" (pDelay: ^delay, value: f32) ---

delay_set_dry ¶

delay_set_dry :: proc "cdecl" (pDelay: ^delay, value: f32) ---

delay_set_wet ¶

delay_set_wet :: proc "cdecl" (pDelay: ^delay, value: f32) ---

delay_uninit ¶

delay_uninit :: proc "cdecl" (pDelay: ^delay, pAllocationCallbacks: ^allocation_callbacks) ---

device_config_init ¶

device_config_init :: proc "cdecl" (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 "cdecl" (pDevice: ^device) -> ^context_type ---
 

Retrieves a pointer to the context that owns the given device.

device_get_info ¶

device_get_info :: proc "cdecl" (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 ¶

device_get_log :: proc "cdecl" (pDevice: ^device) -> ^log ---
 

Helper function for retrieving the log object associated with the context that owns this device.

device_get_master_volume ¶

device_get_master_volume :: proc "cdecl" (pDevice: ^device, pVolume: ^f32) -> result ---
 

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 ¶

device_get_master_volume_db :: proc "cdecl" (pDevice: ^device, pVolume: ^f32) -> result ---
 

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 "cdecl" (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 "cdecl" (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 "cdecl" (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 "cdecl" (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 passed into the data callback will be clipped after returning. When set to false (default), 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 the clip. 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 true, the data callback will be fired with a consistent frame
				count as specified by `periodSizeInFrames` or `periodSizeInMilliseconds`. When set to false, 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 procesing 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 "cdecl" (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 ¶

device_is_started :: proc "cdecl" (pDevice: ^device) -> b32 ---
 

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 "cdecl" () -> device_job_thread_config ---

device_job_thread_init ¶

device_job_thread_init :: proc "cdecl" (pConfig: ^device_job_thread_config, pAllocationCallbacks: ^allocation_callbacks, pJobThread: ^device_job_thread) -> result ---

device_job_thread_next ¶

device_job_thread_next :: proc "cdecl" (pJobThread: ^device_job_thread, pJob: ^job) -> result ---

device_job_thread_post ¶

device_job_thread_post :: proc "cdecl" (pJobThread: ^device_job_thread, pJob: ^job) -> result ---

device_job_thread_uninit ¶

device_job_thread_uninit :: proc "cdecl" (pJobThread: ^device_job_thread, pAllocationCallbacks: ^allocation_callbacks) ---

device_post_init ¶

device_post_init :: proc "cdecl" (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 ¶

device_set_master_volume :: proc "cdecl" (pDevice: ^device, volume: f32) -> result ---
 

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 ¶

device_set_master_volume_db :: proc "cdecl" (pDevice: ^device, volume: f32) -> result ---
 

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 ¶

device_start :: proc "cdecl" (pDevice: ^device) -> result ---
 

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 ¶

device_stop :: proc "cdecl" (pDevice: ^device) -> result ---
 

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.

This will be called implicitly by `ma_device_uninit()`.


See Also
--------
ma_device_start()

device_uninit ¶

device_uninit :: proc "cdecl" (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()

duplex_rb_init ¶

duplex_rb_init :: proc "cdecl" (
	captureFormat:                                                format, 
	captureChannels:                                              u32, 
	sampleRate:                                                   u32, 
	captureInternalSampleRate, captureInternalPeriodSizeInFrames: u32, 
	pAllocationCallbacks:                                         ^allocation_callbacks, 
) -> result ---

duplex_rb_uninit ¶

duplex_rb_uninit :: proc "cdecl" (pRB: ^duplex_rb) -> result ---

encoder_config_init ¶

encoder_config_init :: proc "cdecl" (encodingFormat: encoding_format, format: format, channels: u32, sampleRate: u32) -> encoder_config ---

encoder_init ¶

encoder_init :: proc "cdecl" (onWrite: encoder_write_proc, onSeek: encoder_seek_proc, pUserData: rawptr, pConfig: ^encoder_config, pEncoder: ^encoder) -> result ---

encoder_init_file ¶

encoder_init_file :: proc "cdecl" (pFilePath: cstring, pConfig: ^encoder_config, pEncoder: ^encoder) -> result ---

encoder_init_file_w ¶

encoder_init_file_w :: proc "cdecl" (pFilePath: [^]u16, pConfig: ^encoder_config, pEncoder: ^encoder) -> result ---

encoder_init_vfs ¶

encoder_init_vfs :: proc "cdecl" (pVFS: ^vfs, pFilePath: cstring, pConfig: ^encoder_config, pEncoder: ^encoder) -> result ---

encoder_init_vfs_w ¶

encoder_init_vfs_w :: proc "cdecl" (pVFS: ^vfs, pFilePath: [^]u16, pConfig: ^encoder_config, pEncoder: ^encoder) -> result ---

encoder_uninit ¶

encoder_uninit :: proc "cdecl" (pEncoder: ^encoder) ---

encoder_write_pcm_frames ¶

encoder_write_pcm_frames :: proc "cdecl" (pEncoder: ^encoder, pFramesIn: rawptr, frameCount: u64, pFramesWritten: ^u64) -> result ---

engine_config_init ¶

engine_config_init :: proc "cdecl" () -> engine_config ---

engine_find_closest_listener ¶

engine_find_closest_listener :: proc "cdecl" (pEngine: ^engine, absolutePosX, absolutePosY, absolutePosZ: f32) -> u32 ---

engine_get_channels ¶

engine_get_channels :: proc "cdecl" (pEngine: ^engine) -> u32 ---

engine_get_device ¶

engine_get_device :: proc "cdecl" (pEngine: ^engine) -> ^device ---

engine_get_endpoint ¶

engine_get_endpoint :: proc "cdecl" (pEngine: ^engine) -> ^node ---

engine_get_listener_count ¶

engine_get_listener_count :: proc "cdecl" (pEngine: ^engine) -> u32 ---

engine_get_log ¶

engine_get_log :: proc "cdecl" (pEngine: ^engine) -> ^log ---

engine_get_node_graph ¶

engine_get_node_graph :: proc "cdecl" (pEngine: ^engine) -> ^node_graph ---

engine_get_resource_manager ¶

engine_get_resource_manager :: proc "cdecl" (pEngine: ^engine) -> ^resource_manager ---

engine_get_sample_rate ¶

engine_get_sample_rate :: proc "cdecl" (pEngine: ^engine) -> u32 ---

engine_get_time ¶

engine_get_time :: proc "cdecl" (pEngine: ^engine) -> u64 ---

engine_init ¶

engine_init :: proc "cdecl" (pConfig: ^engine_config, pEngine: ^engine) -> result ---

engine_listener_get_cone ¶

engine_listener_get_cone :: proc "cdecl" (pEngine: ^engine, listenerIndex: u32, pInnerAngleInRadians, pOuterAngleInRadians, pOuterGain: ^f32) ---

engine_listener_get_direction ¶

engine_listener_get_direction :: proc "cdecl" (pEngine: ^engine, listenerIndex: u32) -> vec3f ---

engine_listener_get_position ¶

engine_listener_get_position :: proc "cdecl" (pEngine: ^engine, listenerIndex: u32) -> vec3f ---

engine_listener_get_velocity ¶

engine_listener_get_velocity :: proc "cdecl" (pEngine: ^engine, listenerIndex: u32) -> vec3f ---

engine_listener_get_world_up ¶

engine_listener_get_world_up :: proc "cdecl" (pEngine: ^engine, listenerIndex: u32) -> vec3f ---

engine_listener_is_enabled ¶

engine_listener_is_enabled :: proc "cdecl" (pEngine: ^engine, listenerIndex: u32) -> b32 ---

engine_listener_set_cone ¶

engine_listener_set_cone :: proc "cdecl" (pEngine: ^engine, listenerIndex: u32, x, y, z: f32) ---

engine_listener_set_direction ¶

engine_listener_set_direction :: proc "cdecl" (pEngine: ^engine, listenerIndex: u32, x, y, z: f32) ---

engine_listener_set_enabled ¶

engine_listener_set_enabled :: proc "cdecl" (pEngine: ^engine, listenerIndex: u32, isEnabled: b32) ---

engine_listener_set_position ¶

engine_listener_set_position :: proc "cdecl" (pEngine: ^engine, listenerIndex: u32, x, y, z: f32) ---

engine_listener_set_velocity ¶

engine_listener_set_velocity :: proc "cdecl" (pEngine: ^engine, listenerIndex: u32, x, y, z: f32) ---

engine_listener_set_world_up ¶

engine_listener_set_world_up :: proc "cdecl" (pEngine: ^engine, listenerIndex: u32, x, y, z: f32) ---

engine_node_config_init ¶

engine_node_config_init :: proc "cdecl" (pEngine: ^engine, type: engine_node_type, flags: u32) -> engine_node_config ---

engine_node_get_heap_size ¶

engine_node_get_heap_size :: proc "cdecl" (pConfig: ^engine_node_config, pHeapSizeInBytes: ^uint) -> result ---

engine_node_init ¶

engine_node_init :: proc "cdecl" (pConfig: ^engine_node_config, pAllocationCallbacks: ^allocation_callbacks, pEngineNode: ^engine_node) -> result ---

engine_node_init_preallocated ¶

engine_node_init_preallocated :: proc "cdecl" (pConfig: ^engine_node_config, pHeap: rawptr, pEngineNode: ^engine_node) -> result ---

engine_node_uninit ¶

engine_node_uninit :: proc "cdecl" (pEngineNode: ^engine_node, pAllocationCallbacks: ^allocation_callbacks) ---

engine_play_sound ¶

engine_play_sound :: proc "cdecl" (pEngine: ^engine, pFilePath: cstring, pGroup: ^sound_group) -> result ---

engine_play_sound_ex ¶

engine_play_sound_ex :: proc "cdecl" (pEngine: ^engine, pFilePath: cstring, pNode: ^node, nodeInputBusIndex: u32) -> result ---

engine_read_pcm_frames ¶

engine_read_pcm_frames :: proc "cdecl" (pEngine: ^engine, pFramesOut: rawptr, frameCount: u64, pFramesRead: ^u64) -> result ---

engine_set_gain_db ¶

engine_set_gain_db :: proc "cdecl" (pEngine: ^engine, volume: f32) -> result ---

engine_set_time ¶

engine_set_time :: proc "cdecl" (pEngine: ^engine, globalTime: u64) -> result ---

engine_set_volume ¶

engine_set_volume :: proc "cdecl" (pEngine: ^engine, volume: f32) -> result ---

engine_start ¶

engine_start :: proc "cdecl" (pEngine: ^engine) -> result ---

engine_stop ¶

engine_stop :: proc "cdecl" (pEngine: ^engine) -> result ---

engine_uninit ¶

engine_uninit :: proc "cdecl" (pEngine: ^engine) ---

fader_config_init ¶

fader_config_init :: proc "cdecl" (format: format, channels, sampleRate: u32) -> fader_config ---

fader_get_current_volume ¶

fader_get_current_volume :: proc "cdecl" (pFader: ^fader) -> f32 ---

fader_get_data_format ¶

fader_get_data_format :: proc "cdecl" (pFader: ^fader, pFormat: ^format, pChannels, pSampleRate: ^u32) ---

fader_init ¶

fader_init :: proc "cdecl" (pConfig: ^fader_config, pFader: ^fader) -> result ---

fader_process_pcm_frames ¶

fader_process_pcm_frames :: proc "cdecl" (pFader: ^fader, pFramesOut, pFramesIn: rawptr, frameCount: u64) -> result ---

fader_set_fade ¶

fader_set_fade :: proc "cdecl" (pFader: ^fader, volumeBeg, volumeEnd: f32, lengthInFrames: u64) ---

fence_acquire ¶

fence_acquire :: proc "cdecl" (pFence: ^fence) -> result ---

fence_init ¶

fence_init :: proc "cdecl" (pFence: ^fence) -> result ---

fence_release ¶

fence_release :: proc "cdecl" (pFence: ^fence) -> result ---

fence_uninit ¶

fence_uninit :: proc "cdecl" (pFence: ^fence) ---

fence_wait ¶

fence_wait :: proc "cdecl" (pFence: ^fence) -> result ---

free ¶

free :: proc "cdecl" (p: rawptr, pAllocationCallbacks: ^allocation_callbacks) ---
 

free()

gainer_config_init ¶

gainer_config_init :: proc "cdecl" (channels, smoothTimeInFrames: u32) -> gainer_config ---

gainer_get_heap_size ¶

gainer_get_heap_size :: proc "cdecl" (pConfig: ^gainer_config, pHeapSizeInBytes: ^uint) -> result ---

gainer_init ¶

gainer_init :: proc "cdecl" (pConfig: ^gainer_config, pAllocationCallbacks: ^allocation_callbacks, pGainer: ^gainer) -> result ---

gainer_init_preallocated ¶

gainer_init_preallocated :: proc "cdecl" (pConfig: ^gainer_config, pHeap: rawptr, pGainer: ^gainer) -> result ---

gainer_process_pcm_frames ¶

gainer_process_pcm_frames :: proc "cdecl" (pGainer: ^gainer, pFramesOut: rawptr, pFramesIn: rawptr, frameCount: u64) -> result ---

gainer_set_gain ¶

gainer_set_gain :: proc "cdecl" (pGainer: ^gainer, newGain: f32) -> result ---

gainer_set_gains ¶

gainer_set_gains :: proc "cdecl" (pGainer: ^gainer, pNewGains: [^]f32) -> result ---

gainer_uninit ¶

gainer_uninit :: proc "cdecl" (pGainer: ^gainer, pAllocationCallbacks: ^allocation_callbacks) ---

get_backend_name ¶

get_backend_name :: proc "cdecl" (backend: backend) -> cstring ---
 

Retrieves a friendly name for a backend.

get_bytes_per_frame ¶

get_bytes_per_frame :: proc "cdecl" (format: format, channels: u32) -> u32 {…}

get_bytes_per_sample ¶

get_bytes_per_sample :: proc "cdecl" (format: format) -> u32 ---
 

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 "cdecl" (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 ¶

get_format_name :: proc "cdecl" (format: format) -> cstring ---
 

Retrieves a friendly name for a format.

hishelf2_config_init ¶

hishelf2_config_init :: proc "cdecl" (
	format:             format, 
	channels:           u32, 
	sampleRate:         u32, 
	gainDB, shelfSlope, 
) -> hishelf_config ---

hishelf2_get_heap_size ¶

hishelf2_get_heap_size :: proc "cdecl" (pConfig: ^hishelf_config, pHeapSizeInBytes: ^uint) -> result ---

hishelf2_get_latency ¶

hishelf2_get_latency :: proc "cdecl" (pFilter: ^hishelf2) -> u32 ---

hishelf2_init ¶

hishelf2_init :: proc "cdecl" (pConfig: ^hishelf_config, pAllocationCallbacks: ^allocation_callbacks, pFilter: ^hishelf2) -> result ---

hishelf2_init_preallocated ¶

hishelf2_init_preallocated :: proc "cdecl" (pConfig: ^hishelf_config, pHeap: rawptr, pFilter: ^hishelf2) -> result ---

hishelf2_process_pcm_frames ¶

hishelf2_process_pcm_frames :: proc "cdecl" (pFilter: ^hishelf2, pFramesOut: rawptr, pFramesIn: rawptr, frameCount: u64) -> result ---

hishelf2_reinit ¶

hishelf2_reinit :: proc "cdecl" (pConfig: ^hishelf_config, pFilter: ^hishelf2) -> result ---

hishelf2_uninit ¶

hishelf2_uninit :: proc "cdecl" (pFilter: ^hishelf2, pAllocationCallbacks: ^allocation_callbacks) ---

hishelf_node_config_init ¶

hishelf_node_config_init :: proc "cdecl" (channels, sampleRate: u32, gainDB, q, frequency: f64) -> hishelf_node_config ---

hishelf_node_init ¶

hishelf_node_init :: proc "cdecl" (pNodeGraph: ^node_graph, pConfig: ^hishelf_node_config, pAllocationCallbacks: ^allocation_callbacks, pNode: ^hishelf_node) -> result ---

hishelf_node_reinit ¶

hishelf_node_reinit :: proc "cdecl" (pConfig: ^hishelf_config, pNode: ^hishelf_node) -> result ---

hishelf_node_uninit ¶

hishelf_node_uninit :: proc "cdecl" (pNode: ^hishelf_node, pAllocationCallbacks: ^allocation_callbacks) ---

hpf1_config_init ¶

hpf1_config_init :: proc "cdecl" (format: format, channels: u32, sampleRate: u32, cutoffFrequency: f64) -> hpf1_config ---

hpf1_get_heap_size ¶

hpf1_get_heap_size :: proc "cdecl" (pConfig: ^hpf1_config, pHeapSizeInBytes: ^uint) -> result ---

hpf1_get_latency ¶

hpf1_get_latency :: proc "cdecl" (pHPF: ^hpf1) -> u32 ---

hpf1_init ¶

hpf1_init :: proc "cdecl" (pConfig: ^hpf1_config, pAllocationCallbacks: ^allocation_callbacks, pHPF: ^hpf1) -> result ---

hpf1_init_preallocated ¶

hpf1_init_preallocated :: proc "cdecl" (pConfig: ^hpf1_config, pHeap: rawptr, pLPF: ^hpf1) -> result ---

hpf1_process_pcm_frames ¶

hpf1_process_pcm_frames :: proc "cdecl" (pHPF: ^hpf1, pFramesOut: rawptr, pFramesIn: rawptr, frameCount: u64) -> result ---

hpf1_reinit ¶

hpf1_reinit :: proc "cdecl" (pConfig: ^hpf1_config, pHPF: ^hpf1) -> result ---

hpf1_uninit ¶

hpf1_uninit :: proc "cdecl" (pHPF: ^hpf1, pAllocationCallbacks: ^allocation_callbacks) ---

hpf2_config_init ¶

hpf2_config_init :: proc "cdecl" (format: format, channels: u32, sampleRate: u32, cutoffFrequency, q: f64) -> hpf1_config ---

hpf2_get_heap_size ¶

hpf2_get_heap_size :: proc "cdecl" (pConfig: ^hpf1_config, pHeapSizeInBytes: ^uint) -> result ---

hpf2_get_latency ¶

hpf2_get_latency :: proc "cdecl" (pHPF: ^hpf2) -> u32 ---

hpf2_init ¶

hpf2_init :: proc "cdecl" (pConfig: ^hpf1_config, pAllocationCallbacks: ^allocation_callbacks, pHPF: ^hpf2) -> result ---

hpf2_init_preallocated ¶

hpf2_init_preallocated :: proc "cdecl" (pConfig: ^hpf1_config, pHeap: rawptr, pHPF: ^hpf2) -> result ---

hpf2_process_pcm_frames ¶

hpf2_process_pcm_frames :: proc "cdecl" (pHPF: ^hpf2, pFramesOut: rawptr, pFramesIn: rawptr, frameCount: u64) -> result ---

hpf2_reinit ¶

hpf2_reinit :: proc "cdecl" (pConfig: ^hpf1_config, pHPF: ^hpf2) -> result ---

hpf2_uninit ¶

hpf2_uninit :: proc "cdecl" (pHPF: ^hpf2, pAllocationCallbacks: ^allocation_callbacks) ---

hpf_config_init ¶

hpf_config_init :: proc "cdecl" (format: format, channels: u32, sampleRate: u32, cutoffFrequency: f64, order: u32) -> hpf_config ---

hpf_get_heap_size ¶

hpf_get_heap_size :: proc "cdecl" (pConfig: ^hpf_config, pHeapSizeInBytes: ^uint) -> result ---

hpf_get_latency ¶

hpf_get_latency :: proc "cdecl" (pHPF: ^hpf) -> u32 ---

hpf_init ¶

hpf_init :: proc "cdecl" (pConfig: ^hpf_config, pAllocationCallbacks: ^allocation_callbacks, pHPF: ^hpf) -> result ---

hpf_init_preallocated ¶

hpf_init_preallocated :: proc "cdecl" (pConfig: ^hpf_config, pHeap: rawptr, pLPF: ^hpf) -> result ---

hpf_node_config_init ¶

hpf_node_config_init :: proc "cdecl" (channels, sampleRate: u32, cutoffFrequency: f64, order: u32) -> hpf_node_config ---

hpf_node_init ¶

hpf_node_init :: proc "cdecl" (pNodeGraph: ^node_graph, pConfig: ^hpf_node_config, pAllocationCallbacks: ^allocation_callbacks, pNode: ^hpf_node) -> result ---

hpf_node_reinit ¶

hpf_node_reinit :: proc "cdecl" (pConfig: ^hpf_config, pNode: ^hpf_node) -> result ---

hpf_node_uninit ¶

hpf_node_uninit :: proc "cdecl" (pNode: ^hpf_node, pAllocationCallbacks: ^allocation_callbacks) ---

hpf_process_pcm_frames ¶

hpf_process_pcm_frames :: proc "cdecl" (pHPF: ^hpf, pFramesOut: rawptr, pFramesIn: rawptr, frameCount: u64) -> result ---

hpf_reinit ¶

hpf_reinit :: proc "cdecl" (pConfig: ^hpf_config, pHPF: ^hpf) -> result ---

hpf_uninit ¶

hpf_uninit :: proc "cdecl" (pHPF: ^hpf, pAllocationCallbacks: ^allocation_callbacks) ---

interleave_pcm_frames ¶

interleave_pcm_frames :: proc "cdecl" (format: format, channels: u32, frameCount: u64, ppDeinterleavedPCMFrames: ^rawptr, pInterleavedPCMFrames: rawptr) ---
 

Interleaves a group of deinterleaved buffers.

is_backend_enabled ¶

is_backend_enabled :: proc "cdecl" (backend: backend) -> b32 ---
 

Determines whether or not the given backend is available by the compilation environment.

is_loopback_supported ¶

is_loopback_supported :: proc "cdecl" (backend: backend) -> b32 ---
 

Determines whether or not loopback mode is support by a backend.

job_init ¶

job_init :: proc "cdecl" (code: u16) -> job ---

job_process ¶

job_process :: proc "cdecl" (pJob: ^job) -> result ---

job_queue_config_init ¶

job_queue_config_init :: proc "cdecl" (flags, capacity: u32) -> job_queue_config ---

job_queue_get_heap_size ¶

job_queue_get_heap_size :: proc "cdecl" (pConfig: ^job_queue_config, pHeapSizeInBytes: ^uint) -> result ---

job_queue_init ¶

job_queue_init :: proc "cdecl" (pConfig: ^job_queue_config, pAllocationCallbacks: ^allocation_callbacks, pQueue: ^job_queue) -> result ---

job_queue_init_preallocated ¶

job_queue_init_preallocated :: proc "cdecl" (pConfig: ^job_queue_config, pHeap: rawptr, pQueue: ^job_queue) -> result ---

job_queue_next ¶

job_queue_next :: proc "cdecl" (pQueue: ^job_queue, pJob: ^job) -> result ---

job_queue_post ¶

job_queue_post :: proc "cdecl" (pQueue: ^job_queue, pJob: ^job) -> result ---

job_queue_uninit ¶

job_queue_uninit :: proc "cdecl" (pQueue: ^job_queue, pAllocationCallbacks: ^allocation_callbacks) ---

linear_resampler_config_init ¶

linear_resampler_config_init :: proc "cdecl" (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 "cdecl" (pResampler: ^linear_resampler, outputFrameCount: u64, pInputFrameCount: ^u64) -> result ---

linear_resampler_get_heap_size ¶

linear_resampler_get_heap_size :: proc "cdecl" (pConfig: ^linear_resampler_config, pHeapSizeInBytes: ^uint) -> result ---

linear_resampler_get_input_latency ¶

linear_resampler_get_input_latency :: proc "cdecl" (pResampler: ^linear_resampler) -> u64 ---

linear_resampler_get_output_latency ¶

linear_resampler_get_output_latency :: proc "cdecl" (pResampler: ^linear_resampler) -> u64 ---

linear_resampler_get_required_input_frame_count ¶

linear_resampler_get_required_input_frame_count :: proc "cdecl" (pResampler: ^linear_resampler, outputFrameCount: u64, pInputFrameCount: ^u64) -> result ---

linear_resampler_init ¶

linear_resampler_init :: proc "cdecl" (pConfig: ^linear_resampler_config, pAllocationCallbacks: ^allocation_callbacks, pResampler: ^linear_resampler) -> result ---

linear_resampler_init_preallocated ¶

linear_resampler_init_preallocated :: proc "cdecl" (pConfig: ^linear_resampler_config, pHeap: rawptr, pResampler: ^linear_resampler) -> result ---

linear_resampler_process_pcm_frames ¶

linear_resampler_process_pcm_frames :: proc "cdecl" (pResampler: ^linear_resampler, pFramesIn: rawptr, pFrameCountIn: ^u64, pFramesOut: rawptr, pFrameCountOut: ^u64) -> result ---

linear_resampler_reset ¶

linear_resampler_reset :: proc "cdecl" (pResampler: ^linear_resampler) -> result ---

linear_resampler_set_rate ¶

linear_resampler_set_rate :: proc "cdecl" (pResampler: ^linear_resampler, sampleRateIn, sampleRateOut: u32) -> result ---

linear_resampler_set_rate_ratio ¶

linear_resampler_set_rate_ratio :: proc "cdecl" (pResampler: ^linear_resampler, ratioInOut: f32) -> result ---

linear_resampler_uninit ¶

linear_resampler_uninit :: proc "cdecl" (pResampler: ^linear_resampler, pAllocationCallbacks: ^allocation_callbacks) ---

log_callback_init ¶

log_callback_init :: proc "cdecl" (onLog: log_callback_proc, pUserData: rawptr) -> log_callback ---

log_init ¶

log_init :: proc "cdecl" (pAllocationCallbacks: ^allocation_callbacks, pLog: ^log) -> result ---

log_level_to_string ¶

log_level_to_string :: proc "cdecl" (logLevel: u32) -> cstring ---
 

Converts a log level to a string.

log_post ¶

log_post :: proc "cdecl" (pLog: ^log, level: u32, pMessage: cstring) -> result ---

log_postf ¶

log_postf :: proc "cdecl" (pLog: ^log, level: u32, pFormat: cstring, args: ..any) -> result ---

log_postv ¶

log_postv :: proc "cdecl" (pLog: ^log, level: u32, pFormat: cstring, args: libc.va_list) -> result ---

log_register_callback ¶

log_register_callback :: proc "cdecl" (pLog: ^log, callback: log_callback) -> result ---

log_uninit ¶

log_uninit :: proc "cdecl" (pLog: ^log) ---

log_unregister_callback ¶

log_unregister_callback :: proc "cdecl" (pLog: ^log, callback: log_callback) -> result ---

loshelf2_config_init ¶

loshelf2_config_init :: proc "cdecl" (
	format:             format, 
	channels:           u32, 
	sampleRate:         u32, 
	gainDB, shelfSlope, 
) -> loshelf_config ---

loshelf2_get_heap_size ¶

loshelf2_get_heap_size :: proc "cdecl" (pConfig: ^loshelf_config, pHeapSizeInBytes: ^uint) -> result ---

loshelf2_get_latency ¶

loshelf2_get_latency :: proc "cdecl" (pFilter: ^loshelf2) -> u32 ---

loshelf2_init ¶

loshelf2_init :: proc "cdecl" (pConfig: ^loshelf_config, pAllocationCallbacks: ^allocation_callbacks, pFilter: ^loshelf2) -> result ---

loshelf2_init_preallocated ¶

loshelf2_init_preallocated :: proc "cdecl" (pConfig: ^loshelf_config, pHeap: rawptr, pFilter: ^loshelf2) -> result ---

loshelf2_process_pcm_frames ¶

loshelf2_process_pcm_frames :: proc "cdecl" (pFilter: ^loshelf2, pFramesOut: rawptr, pFramesIn: rawptr, frameCount: u64) -> result ---

loshelf2_reinit ¶

loshelf2_reinit :: proc "cdecl" (pConfig: ^loshelf_config, pFilter: ^loshelf2) -> result ---

loshelf2_uninit ¶

loshelf2_uninit :: proc "cdecl" (pFilter: ^loshelf2, pAllocationCallbacks: ^allocation_callbacks) ---

loshelf_node_config_init ¶

loshelf_node_config_init :: proc "cdecl" (channels, sampleRate: u32, gainDB, q, frequency: f64) -> loshelf_node_config ---

loshelf_node_init ¶

loshelf_node_init :: proc "cdecl" (pNodeGraph: ^node_graph, pConfig: ^loshelf_node_config, pAllocationCallbacks: ^allocation_callbacks, pNode: ^loshelf_node) -> result ---

loshelf_node_reinit ¶

loshelf_node_reinit :: proc "cdecl" (pConfig: ^loshelf_config, pNode: ^loshelf_node) -> result ---

loshelf_node_uninit ¶

loshelf_node_uninit :: proc "cdecl" (pNode: ^loshelf_node, pAllocationCallbacks: ^allocation_callbacks) ---

lpf1_clear_cache ¶

lpf1_clear_cache :: proc "cdecl" (pLPF: ^lpf1) -> result ---

lpf1_config_init ¶

lpf1_config_init :: proc "cdecl" (format: format, channels: u32, sampleRate: u32, cutoffFrequency: f64) -> lpf1_config ---

lpf1_get_heap_size ¶

lpf1_get_heap_size :: proc "cdecl" (pConfig: ^lpf1_config, pHeapSizeInBytes: ^uint) -> result ---

lpf1_get_latency ¶

lpf1_get_latency :: proc "cdecl" (pLPF: ^lpf1) -> u32 ---

lpf1_init ¶

lpf1_init :: proc "cdecl" (pConfig: ^lpf1_config, pAllocationCallbacks: ^allocation_callbacks, pLPF: ^lpf1) -> result ---

lpf1_init_preallocated ¶

lpf1_init_preallocated :: proc "cdecl" (pConfig: ^lpf1_config, pHeap: rawptr, pLPF: ^lpf1) -> result ---

lpf1_process_pcm_frames ¶

lpf1_process_pcm_frames :: proc "cdecl" (pLPF: ^lpf1, pFramesOut: rawptr, pFramesIn: rawptr, frameCount: u64) -> result ---

lpf1_reinit ¶

lpf1_reinit :: proc "cdecl" (pConfig: ^lpf1_config, pLPF: ^lpf1) -> result ---

lpf1_uninit ¶

lpf1_uninit :: proc "cdecl" (pLPF: ^lpf1, pAllocationCallbacks: ^allocation_callbacks) ---

lpf2_clear_cache ¶

lpf2_clear_cache :: proc "cdecl" (pLPF: ^lpf2) -> result ---

lpf2_config_init ¶

lpf2_config_init :: proc "cdecl" (format: format, channels: u32, sampleRate: u32, cutoffFrequency, q: f64) -> lpf1_config ---

lpf2_get_heap_size ¶

lpf2_get_heap_size :: proc "cdecl" (pConfig: ^lpf1_config, pHeapSizeInBytes: ^uint) -> result ---

lpf2_get_latency ¶

lpf2_get_latency :: proc "cdecl" (pLPF: ^lpf2) -> u32 ---

lpf2_init ¶

lpf2_init :: proc "cdecl" (pConfig: ^lpf1_config, pAllocationCallbacks: ^allocation_callbacks, pLPF: ^lpf2) -> result ---

lpf2_init_preallocated ¶

lpf2_init_preallocated :: proc "cdecl" (pConfig: ^lpf1_config, pHeap: rawptr, pHPF: ^lpf2) -> result ---

lpf2_process_pcm_frames ¶

lpf2_process_pcm_frames :: proc "cdecl" (pLPF: ^lpf2, pFramesOut: rawptr, pFramesIn: rawptr, frameCount: u64) -> result ---

lpf2_reinit ¶

lpf2_reinit :: proc "cdecl" (pConfig: ^lpf1_config, pLPF: ^lpf2) -> result ---

lpf2_uninit ¶

lpf2_uninit :: proc "cdecl" (pLPF: ^lpf2, pAllocationCallbacks: ^allocation_callbacks) ---

lpf_clear_cache ¶

lpf_clear_cache :: proc "cdecl" (pLPF: ^lpf) -> result ---

lpf_config_init ¶

lpf_config_init :: proc "cdecl" (format: format, channels: u32, sampleRate: u32, cutoffFrequency: f64, order: u32) -> lpf_config ---

lpf_get_heap_size ¶

lpf_get_heap_size :: proc "cdecl" (pConfig: ^lpf_config, pHeapSizeInBytes: ^uint) -> result ---

lpf_get_latency ¶

lpf_get_latency :: proc "cdecl" (pLPF: ^lpf) -> u32 ---

lpf_init ¶

lpf_init :: proc "cdecl" (pConfig: ^lpf_config, pAllocationCallbacks: ^allocation_callbacks, pLPF: ^lpf) -> result ---

lpf_init_preallocated ¶

lpf_init_preallocated :: proc "cdecl" (pConfig: ^lpf_config, pHeap: rawptr, pLPF: ^lpf) -> result ---

lpf_node_config_init ¶

lpf_node_config_init :: proc "cdecl" (channels, sampleRate: u32, cutoffFrequency: f64, order: u32) -> lpf_node_config ---

lpf_node_init ¶

lpf_node_init :: proc "cdecl" (pNodeGraph: ^node_graph, pConfig: ^lpf_node_config, pAllocationCallbacks: ^allocation_callbacks, pNode: ^lpf_node) -> result ---

lpf_node_reinit ¶

lpf_node_reinit :: proc "cdecl" (pConfig: ^lpf_config, pNode: ^lpf_node) -> result ---

lpf_node_uninit ¶

lpf_node_uninit :: proc "cdecl" (pNode: ^lpf_node, pAllocationCallbacks: ^allocation_callbacks) ---

lpf_process_pcm_frames ¶

lpf_process_pcm_frames :: proc "cdecl" (pLPF: ^lpf, pFramesOut: rawptr, pFramesIn: rawptr, frameCount: u64) -> result ---

lpf_reinit ¶

lpf_reinit :: proc "cdecl" (pConfig: ^lpf_config, pLPF: ^lpf) -> result ---

lpf_uninit ¶

lpf_uninit :: proc "cdecl" (pLPF: ^lpf, pAllocationCallbacks: ^allocation_callbacks) ---

ma_copy_and_apply_volume_and_clip_pcm_frames ¶

ma_copy_and_apply_volume_and_clip_pcm_frames :: proc "cdecl" (
	pFramesOut, pFramesIn: rawptr, 
	frameCount:            u64, 
	format:                format, 
	channels:              u32, 
) ---

ma_copy_and_apply_volume_and_clip_samples_f32 ¶

ma_copy_and_apply_volume_and_clip_samples_f32 :: proc "cdecl" (pDst, pSrc: [^]f32, count: u64, volume: f32) ---

ma_copy_and_apply_volume_and_clip_samples_s16 ¶

ma_copy_and_apply_volume_and_clip_samples_s16 :: proc "cdecl" (pDst: [^]i16, pSrc: [^]i32, count: u64, volume: f32) ---

ma_copy_and_apply_volume_and_clip_samples_s24 ¶

ma_copy_and_apply_volume_and_clip_samples_s24 :: proc "cdecl" (pDst: [^]u8, pSrc: [^]i64, count: u64, volume: f32) ---

ma_copy_and_apply_volume_and_clip_samples_s32 ¶

ma_copy_and_apply_volume_and_clip_samples_s32 :: proc "cdecl" (pDst: [^]i32, pSrc: [^]i64, count: u64, volume: f32) ---

ma_copy_and_apply_volume_and_clip_samples_u8 ¶

ma_copy_and_apply_volume_and_clip_samples_u8 :: proc "cdecl" (pDst: [^]u8, pSrc: [^]i16, count: u64, volume: f32) ---

malloc ¶

malloc :: proc "cdecl" (sz: uint, pAllocationCallbacks: ^allocation_callbacks) -> rawptr ---
 

malloc()

node_attach_output_bus ¶

node_attach_output_bus :: proc "cdecl" (pNode: ^node, outputBusIndex: u32, pOtherNode: ^node, otherNodeInputBusIndex: u32) -> result ---

node_config_init ¶

node_config_init :: proc "cdecl" () -> node_config ---

node_detach_all_output_buses ¶

node_detach_all_output_buses :: proc "cdecl" (pNode: ^node) -> result ---

node_detach_output_bus ¶

node_detach_output_bus :: proc "cdecl" (pNode: ^node, outputBusIndex: u32) -> result ---

node_get_heap_size ¶

node_get_heap_size :: proc "cdecl" (pNodeGraph: ^node_graph, pConfig: ^node_config, pHeapSizeInBytes: ^uint) -> result ---

node_get_input_bus_count ¶

node_get_input_bus_count :: proc "cdecl" (pNode: ^node) -> u32 ---

node_get_input_channels ¶

node_get_input_channels :: proc "cdecl" (pNode: ^node, inputBusIndex: u32) -> u32 ---

node_get_node_graph ¶

node_get_node_graph :: proc "cdecl" (pNode: ^node) -> ^node_graph ---

node_get_output_bus_count ¶

node_get_output_bus_count :: proc "cdecl" (pNode: ^node) -> u32 ---

node_get_output_bus_volume ¶

node_get_output_bus_volume :: proc "cdecl" (pNode: ^node, outputBusIndex: u32) -> f32 ---

node_get_output_channels ¶

node_get_output_channels :: proc "cdecl" (pNode: ^node, inputBusIndex: u32) -> u32 ---

node_get_state ¶

node_get_state :: proc "cdecl" (pNode: ^node) -> node_state ---

node_get_state_by_time ¶

node_get_state_by_time :: proc "cdecl" (pNode: ^node, globalTime: u64) -> node_state ---

node_get_state_by_time_range ¶

node_get_state_by_time_range :: proc "cdecl" (pNode: ^node, globalTimeBeg: u64, globalTimeEnd: u64) -> node_state ---

node_get_state_time ¶

node_get_state_time :: proc "cdecl" (pNode: ^node, state: node_state) -> u64 ---

node_get_time ¶

node_get_time :: proc "cdecl" (pNode: ^node) -> u64 ---

node_graph_config_init ¶

node_graph_config_init :: proc "cdecl" (channels: u32) -> node_graph_config ---

node_graph_get_channels ¶

node_graph_get_channels :: proc "cdecl" (pNodeGraph: ^node_graph) -> u32 ---

node_graph_get_endpoint ¶

node_graph_get_endpoint :: proc "cdecl" (pNodeGraph: ^node_graph) -> ^node ---

node_graph_get_time ¶

node_graph_get_time :: proc "cdecl" (pNodeGraph: ^node_graph) -> u64 ---

node_graph_init ¶

node_graph_init :: proc "cdecl" (pConfig: ^node_graph_config, pAllocationCallbacks: ^allocation_callbacks, pNodeGraph: ^node_graph) -> result ---

node_graph_read_pcm_frames ¶

node_graph_read_pcm_frames :: proc "cdecl" (pNodeGraph: ^node_graph, pFramesOut: rawptr, frameCount: u64, pFramesRead: ^u64) -> result ---

node_graph_set_time ¶

node_graph_set_time :: proc "cdecl" (pNodeGraph: ^node_graph, globalTime: u64) -> result ---

node_graph_uninit ¶

node_graph_uninit :: proc "cdecl" (pNodeGraph: ^node_graph, pAllocationCallbacks: ^allocation_callbacks) ---

node_init ¶

node_init :: proc "cdecl" (pNodeGraph: ^node_graph, pConfig: ^node_config, pAllocationCallbacks: ^allocation_callbacks, pNode: ^node) -> result ---

node_init_preallocated ¶

node_init_preallocated :: proc "cdecl" (pNodeGraph: ^node_graph, pConfig: ^node_config, pHeap: rawptr, pNode: ^node) -> result ---

node_set_output_bus_volume ¶

node_set_output_bus_volume :: proc "cdecl" (pNode: ^node, outputBusIndex: u32, volume: f32) -> result ---

node_set_state ¶

node_set_state :: proc "cdecl" (pNode: ^node, state: node_state) -> result ---

node_set_state_time ¶

node_set_state_time :: proc "cdecl" (pNode: ^node, state: node_state, globalTime: u64) -> result ---

node_set_time ¶

node_set_time :: proc "cdecl" (pNode: ^node, localTime: u64) -> result ---

node_uninit ¶

node_uninit :: proc "cdecl" (pNode: ^node, pAllocationCallbacks: ^allocation_callbacks) ---

noise_config_init ¶

noise_config_init :: proc "cdecl" (format: format, channels: u32, type: noise_type, seed: i32, amplitude: f64) -> noise_config ---

noise_get_heap_size ¶

noise_get_heap_size :: proc "cdecl" (pConfig: ^noise_config, pHeapSizeInBytes: ^uint) -> result ---

noise_init ¶

noise_init :: proc "cdecl" (pConfig: ^noise_config, pAllocationCallbacks: ^allocation_callbacks, pNoise: ^noise) -> result ---

noise_init_preallocated ¶

noise_init_preallocated :: proc "cdecl" (pConfig: ^noise_config, pHeap: rawptr, pNoise: ^noise) -> result ---

noise_read_pcm_frames ¶

noise_read_pcm_frames :: proc "cdecl" (pNoise: ^noise, pFramesOut: rawptr, frameCount: u64, pFramesRead: ^u64) -> result ---

noise_set_amplitude ¶

noise_set_amplitude :: proc "cdecl" (pNoise: ^noise, amplitude: f64) -> result ---

noise_set_seed ¶

noise_set_seed :: proc "cdecl" (pNoise: ^noise, seed: i32) -> result ---

noise_set_type ¶

noise_set_type :: proc "cdecl" (pNoise: ^noise, type: noise_type) -> result ---

noise_uninit ¶

noise_uninit :: proc "cdecl" (pNoise: ^noise, pAllocationCallbacks: ^allocation_callbacks) ---

notch2_config_init ¶

notch2_config_init :: proc "cdecl" (format: format, channels: u32, sampleRate: u32, q: f64, frequency: f64) -> notch_config ---

notch2_get_heap_size ¶

notch2_get_heap_size :: proc "cdecl" (pConfig: ^notch_config, pHeapSizeInBytes: ^uint) -> result ---

notch2_get_latency ¶

notch2_get_latency :: proc "cdecl" (pFilter: ^notch2) -> u32 ---

notch2_init ¶

notch2_init :: proc "cdecl" (pConfig: ^notch_config, pAllocationCallbacks: ^allocation_callbacks, pFilter: ^notch2) -> result ---

notch2_init_preallocated ¶

notch2_init_preallocated :: proc "cdecl" (pConfig: ^notch_config, pHeap: rawptr, pFilter: ^notch2) -> result ---

notch2_process_pcm_frames ¶

notch2_process_pcm_frames :: proc "cdecl" (pFilter: ^notch2, pFramesOut: rawptr, pFramesIn: rawptr, frameCount: u64) -> result ---

notch2_reinit ¶

notch2_reinit :: proc "cdecl" (pConfig: ^notch_config, pFilter: ^notch2) -> result ---

notch2_uninit ¶

notch2_uninit :: proc "cdecl" (pFilter: ^notch2, pAllocationCallbacks: ^allocation_callbacks) ---

notch_node_config_init ¶

notch_node_config_init :: proc "cdecl" (channels, sampleRate: u32, q, frequency: f64) -> notch_node_config ---

notch_node_init ¶

notch_node_init :: proc "cdecl" (pNodeGraph: ^node_graph, pConfig: ^notch_node_config, pAllocationCallbacks: ^allocation_callbacks, pNode: ^notch_node) -> result ---

notch_node_reinit ¶

notch_node_reinit :: proc "cdecl" (pConfig: ^notch_config, pNode: ^notch_node) -> result ---

notch_node_uninit ¶

notch_node_uninit :: proc "cdecl" (pNode: ^notch_node, pAllocationCallbacks: ^allocation_callbacks) ---

offset_pcm_frames_const_ptr ¶

offset_pcm_frames_const_ptr :: proc "cdecl" (p: rawptr, offsetInFrames: u64, format: format, channels: u32) -> rawptr ---

offset_pcm_frames_const_ptr_f32 ¶

offset_pcm_frames_const_ptr_f32 :: proc "cdecl" (p: [^]f32, offsetInFrames: u64, channels: u32) -> [^]f32 {…}

offset_pcm_frames_ptr ¶

offset_pcm_frames_ptr :: proc "cdecl" (p: rawptr, offsetInFrames: u64, format: format, channels: u32) -> rawptr ---
 

Offsets a pointer by the specified number of PCM frames.

offset_pcm_frames_ptr_f32 ¶

offset_pcm_frames_ptr_f32 :: proc "cdecl" (p: [^]f32, offsetInFrames: u64, channels: u32) -> [^]f32 {…}

paged_audio_buffer_config_init ¶

paged_audio_buffer_config_init :: proc "cdecl" (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 "cdecl" (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 "cdecl" (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 "cdecl" (pData: ^paged_audio_buffer_data, pPage: ^paged_audio_buffer_page) -> result ---

paged_audio_buffer_data_free_page ¶

paged_audio_buffer_data_free_page :: proc "cdecl" (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 "cdecl" (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 "cdecl" (pData: ^paged_audio_buffer_data, pLength: ^u64) -> result ---

paged_audio_buffer_data_get_tail ¶

paged_audio_buffer_data_get_tail :: proc "cdecl" (pData: ^paged_audio_buffer_data) -> ^paged_audio_buffer_page ---

paged_audio_buffer_data_init ¶

paged_audio_buffer_data_init :: proc "cdecl" (format: format, channels: u32, pData: ^paged_audio_buffer_data) -> result ---

paged_audio_buffer_data_uninit ¶

paged_audio_buffer_data_uninit :: proc "cdecl" (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 "cdecl" (pPagedAudioBuffer: ^paged_audio_buffer, pCursor: ^u64) -> result ---

paged_audio_buffer_get_length_in_pcm_frames ¶

paged_audio_buffer_get_length_in_pcm_frames :: proc "cdecl" (pPagedAudioBuffer: ^paged_audio_buffer, pCursor: ^u64) -> result ---

paged_audio_buffer_init ¶

paged_audio_buffer_init :: proc "cdecl" (pConfig: ^paged_audio_buffer_config, pPagedAudioBuffer: ^paged_audio_buffer) -> result ---

paged_audio_buffer_read_pcm_frames ¶

paged_audio_buffer_read_pcm_frames :: proc "cdecl" (pPagedAudioBuffer: ^paged_audio_buffer, pFramesOut: rawptr, frameCount: u64, pFramesRead: ^u64) -> result ---

paged_audio_buffer_seek_to_pcm_frame ¶

paged_audio_buffer_seek_to_pcm_frame :: proc "cdecl" (pPagedAudioBuffer: ^paged_audio_buffer, frameIndex: u64) -> result ---

paged_audio_buffer_uninit ¶

paged_audio_buffer_uninit :: proc "cdecl" (pPagedAudioBuffer: ^paged_audio_buffer) ---

panner_config_init ¶

panner_config_init :: proc "cdecl" (format: format, channels: u32) -> panner_config ---

panner_get_mode ¶

panner_get_mode :: proc "cdecl" (pPanner: ^panner) -> pan_mode ---

panner_get_pan ¶

panner_get_pan :: proc "cdecl" (pPanner: ^panner) -> f32 ---

panner_init ¶

panner_init :: proc "cdecl" (pConfig: ^panner_config, pPanner: ^panner) -> result ---

panner_process_pcm_frames ¶

panner_process_pcm_frames :: proc "cdecl" (pPanner: ^panner, pFramesOut, pFramesIn: rawptr, frameCount: u64) -> result ---

panner_set_mode ¶

panner_set_mode :: proc "cdecl" (pPanner: ^panner, mode: pan_mode) ---

panner_set_pan ¶

panner_set_pan :: proc "cdecl" (pPanner: ^panner, pan: f32) ---

pcm_convert ¶

pcm_convert :: proc "cdecl" (
	pOut:        rawptr, 
	formatOut:   format, 
	pIn:         rawptr, 
	formatIn:    format, 
	sampleCount: u64, 
) ---

pcm_f32_to_s16 ¶

pcm_f32_to_s16 :: proc "cdecl" (pOut: rawptr, pIn: rawptr, count: u64, ditherMode: dither_mode) ---

pcm_f32_to_s24 ¶

pcm_f32_to_s24 :: proc "cdecl" (pOut: rawptr, pIn: rawptr, count: u64, ditherMode: dither_mode) ---

pcm_f32_to_s32 ¶

pcm_f32_to_s32 :: proc "cdecl" (pOut: rawptr, pIn: rawptr, count: u64, ditherMode: dither_mode) ---

pcm_f32_to_u8 ¶

pcm_f32_to_u8 :: proc "cdecl" (pOut: rawptr, pIn: rawptr, count: u64, ditherMode: dither_mode) ---

pcm_rb_acquire_read ¶

pcm_rb_acquire_read :: proc "cdecl" (pRB: ^pcm_rb, pSizeInFrames: ^u32, ppBufferOut: ^rawptr) -> result ---

pcm_rb_acquire_write ¶

pcm_rb_acquire_write :: proc "cdecl" (pRB: ^pcm_rb, pSizeInFrames: ^u32, ppBufferOut: ^rawptr) -> result ---

pcm_rb_available_read ¶

pcm_rb_available_read :: proc "cdecl" (pRB: ^pcm_rb) -> u32 ---

pcm_rb_available_write ¶

pcm_rb_available_write :: proc "cdecl" (pRB: ^pcm_rb) -> u32 ---

pcm_rb_commit_read ¶

pcm_rb_commit_read :: proc "cdecl" (pRB: ^pcm_rb, sizeInFrames: u32, pBufferOut: rawptr) -> result ---

pcm_rb_commit_write ¶

pcm_rb_commit_write :: proc "cdecl" (pRB: ^pcm_rb, sizeInFrames: u32, pBufferOut: rawptr) -> result ---

pcm_rb_get_subbuffer_offset ¶

pcm_rb_get_subbuffer_offset :: proc "cdecl" (pRB: ^pcm_rb, subbufferIndex: u32) -> u32 ---

pcm_rb_get_subbuffer_ptr ¶

pcm_rb_get_subbuffer_ptr :: proc "cdecl" (pRB: ^pcm_rb, subbufferIndex: u32, pBuffer: rawptr) -> rawptr ---

pcm_rb_get_subbuffer_size ¶

pcm_rb_get_subbuffer_size :: proc "cdecl" (pRB: ^pcm_rb) -> u32 ---

pcm_rb_get_subbuffer_stride ¶

pcm_rb_get_subbuffer_stride :: proc "cdecl" (pRB: ^pcm_rb) -> u32 ---

pcm_rb_init ¶

pcm_rb_init :: proc "cdecl" (
	format:                      format, 
	channels:                    u32, 
	bufferSizeInFrames:          u32, 
	pOptionalPreallocatedBuffer: rawptr, 
	pAllocationCallbacks:        ^allocation_callbacks, 
) -> result ---

pcm_rb_init_ex ¶

pcm_rb_init_ex :: proc "cdecl" (
	format:                                                         format, 
	channels:                                                       u32, 
	subbufferSizeInFrames, subbufferCount, subbufferStrideInFrames: u32, 
	pOptionalPreallocatedBuffer:                                    rawptr, 
	pAllocationCallbacks:                                           ^allocation_callbacks, 
) -> result ---

pcm_rb_pointer_distance ¶

pcm_rb_pointer_distance :: proc "cdecl" (pRB: ^pcm_rb) -> i32 ---

pcm_rb_reset ¶

pcm_rb_reset :: proc "cdecl" (pRB: ^pcm_rb) ---

pcm_rb_seek_read ¶

pcm_rb_seek_read :: proc "cdecl" (pRB: ^pcm_rb, offsetInFrames: u32) -> result ---

pcm_rb_seek_write ¶

pcm_rb_seek_write :: proc "cdecl" (pRB: ^pcm_rb, offsetInFrames: u32) -> result ---

pcm_rb_uninit ¶

pcm_rb_uninit :: proc "cdecl" (pRB: ^pcm_rb) ---

pcm_s16_to_f32 ¶

pcm_s16_to_f32 :: proc "cdecl" (pOut: rawptr, pIn: rawptr, count: u64, ditherMode: dither_mode) ---

pcm_s16_to_s24 ¶

pcm_s16_to_s24 :: proc "cdecl" (pOut: rawptr, pIn: rawptr, count: u64, ditherMode: dither_mode) ---

pcm_s16_to_s32 ¶

pcm_s16_to_s32 :: proc "cdecl" (pOut: rawptr, pIn: rawptr, count: u64, ditherMode: dither_mode) ---

pcm_s16_to_u8 ¶

pcm_s16_to_u8 :: proc "cdecl" (pOut: rawptr, pIn: rawptr, count: u64, ditherMode: dither_mode) ---

pcm_s24_to_f32 ¶

pcm_s24_to_f32 :: proc "cdecl" (pOut: rawptr, pIn: rawptr, count: u64, ditherMode: dither_mode) ---

pcm_s24_to_s16 ¶

pcm_s24_to_s16 :: proc "cdecl" (pOut: rawptr, pIn: rawptr, count: u64, ditherMode: dither_mode) ---

pcm_s24_to_s32 ¶

pcm_s24_to_s32 :: proc "cdecl" (pOut: rawptr, pIn: rawptr, count: u64, ditherMode: dither_mode) ---

pcm_s24_to_u8 ¶

pcm_s24_to_u8 :: proc "cdecl" (pOut: rawptr, pIn: rawptr, count: u64, ditherMode: dither_mode) ---

pcm_s32_to_f32 ¶

pcm_s32_to_f32 :: proc "cdecl" (pOut: rawptr, pIn: rawptr, count: u64, ditherMode: dither_mode) ---

pcm_s32_to_s16 ¶

pcm_s32_to_s16 :: proc "cdecl" (pOut: rawptr, pIn: rawptr, count: u64, ditherMode: dither_mode) ---

pcm_s32_to_s24 ¶

pcm_s32_to_s24 :: proc "cdecl" (pOut: rawptr, pIn: rawptr, count: u64, ditherMode: dither_mode) ---

pcm_s32_to_u8 ¶

pcm_s32_to_u8 :: proc "cdecl" (pOut: rawptr, pIn: rawptr, count: u64, ditherMode: dither_mode) ---

pcm_u8_to_f32 ¶

pcm_u8_to_f32 :: proc "cdecl" (pOut: rawptr, pIn: rawptr, count: u64, ditherMode: dither_mode) ---

pcm_u8_to_s16 ¶

pcm_u8_to_s16 :: proc "cdecl" (pOut: rawptr, pIn: rawptr, count: u64, ditherMode: dither_mode) ---

pcm_u8_to_s24 ¶

pcm_u8_to_s24 :: proc "cdecl" (pOut: rawptr, pIn: rawptr, count: u64, ditherMode: dither_mode) ---

pcm_u8_to_s32 ¶

pcm_u8_to_s32 :: proc "cdecl" (pOut: rawptr, pIn: rawptr, count: u64, ditherMode: dither_mode) ---

peak2_config_init ¶

peak2_config_init :: proc "cdecl" (
	format:     format, 
	channels:   u32, 
	sampleRate: u32, 
	gainDB, q, 
) -> peak_config ---

peak2_get_heap_size ¶

peak2_get_heap_size :: proc "cdecl" (pConfig: ^peak_config, pHeapSizeInBytes: ^uint) -> result ---

peak2_get_latency ¶

peak2_get_latency :: proc "cdecl" (pFilter: ^peak2) -> u32 ---

peak2_init ¶

peak2_init :: proc "cdecl" (pConfig: ^peak_config, pAllocationCallbacks: ^allocation_callbacks, pFilter: ^peak2) -> result ---

peak2_init_preallocated ¶

peak2_init_preallocated :: proc "cdecl" (pConfig: ^peak_config, pHeap: rawptr, pFilter: ^peak2) -> result ---

peak2_process_pcm_frames ¶

peak2_process_pcm_frames :: proc "cdecl" (pFilter: ^peak2, pFramesOut: rawptr, pFramesIn: rawptr, frameCount: u64) -> result ---

peak2_reinit ¶

peak2_reinit :: proc "cdecl" (pConfig: ^peak_config, pFilter: ^peak2) -> result ---

peak2_uninit ¶

peak2_uninit :: proc "cdecl" (pFilter: ^peak2, pAllocationCallbacks: ^allocation_callbacks) ---

peak_node_config_init ¶

peak_node_config_init :: proc "cdecl" (channels, sampleRate: u32, gainDB, q, frequency: f64) -> peak_node_config ---

peak_node_init ¶

peak_node_init :: proc "cdecl" (pNodeGraph: ^node_graph, pConfig: ^peak_node_config, pAllocationCallbacks: ^allocation_callbacks, pNode: ^peak_node) -> result ---

peak_node_reinit ¶

peak_node_reinit :: proc "cdecl" (pConfig: ^peak_config, pNode: ^peak_node) -> result ---

peak_node_uninit ¶

peak_node_uninit :: proc "cdecl" (pNode: ^peak_node, pAllocationCallbacks: ^allocation_callbacks) ---

rb_acquire_read ¶

rb_acquire_read :: proc "cdecl" (pRB: ^rb, pSizeInBytes: ^uint, ppBufferOut: ^rawptr) -> result ---

rb_acquire_write ¶

rb_acquire_write :: proc "cdecl" (pRB: ^rb, pSizeInBytes: ^uint, ppBufferOut: ^rawptr) -> result ---

rb_available_read ¶

rb_available_read :: proc "cdecl" (pRB: ^rb) -> u32 ---

rb_available_write ¶

rb_available_write :: proc "cdecl" (pRB: ^rb) -> u32 ---

rb_commit_read ¶

rb_commit_read :: proc "cdecl" (pRB: ^rb, sizeInBytes: uint) -> result ---

rb_commit_write ¶

rb_commit_write :: proc "cdecl" (pRB: ^rb, sizeInBytes: uint) -> result ---

rb_get_subbuffer_offset ¶

rb_get_subbuffer_offset :: proc "cdecl" (pRB: ^rb, subbufferIndex: uint) -> uint ---

rb_get_subbuffer_ptr ¶

rb_get_subbuffer_ptr :: proc "cdecl" (pRB: ^rb, subbufferIndex: uint, pBuffer: rawptr) -> rawptr ---

rb_get_subbuffer_size ¶

rb_get_subbuffer_size :: proc "cdecl" (pRB: ^rb) -> uint ---

rb_get_subbuffer_stride ¶

rb_get_subbuffer_stride :: proc "cdecl" (pRB: ^rb) -> uint ---

rb_init ¶

rb_init :: proc "cdecl" (bufferSizeInBytes: uint, pOptionalPreallocatedBuffer: rawptr, pAllocationCallbacks: ^allocation_callbacks, pRB: ^rb) -> result ---

rb_init_ex ¶

rb_init_ex :: proc "cdecl" (
	subbufferSizeInBytes, subbufferCount, subbufferStrideInBytes: uint, 
	pOptionalPreallocatedBuffer:                                  rawptr, 
	pAllocationCallbacks:                                         ^allocation_callbacks, 
) -> result ---

rb_pointer_distance ¶

rb_pointer_distance :: proc "cdecl" (pRB: ^rb) -> i32 ---

rb_reset ¶

rb_reset :: proc "cdecl" (pRB: ^rb) ---

rb_seek_read ¶

rb_seek_read :: proc "cdecl" (pRB: ^rb, sizeInBytes: uint) -> result ---

rb_seek_write ¶

rb_seek_write :: proc "cdecl" (pRB: ^rb, sizeInBytes: uint) -> result ---

rb_uninit ¶

rb_uninit :: proc "cdecl" (pRB: ^rb) ---

realloc ¶

realloc :: proc "cdecl" (p: rawptr, sz: uint, pAllocationCallbacks: ^allocation_callbacks) -> rawptr ---
 

realloc()

resampler_config_init ¶

resampler_config_init :: proc "cdecl" (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 "cdecl" (pResampler: ^resampler, outputFrameCount: u64, pInputFrameCount: ^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 "cdecl" (pConfig: ^resampler_config, pHeapSizeInBytes: ^uint) -> result ---

resampler_get_input_latency ¶

resampler_get_input_latency :: proc "cdecl" (pResampler: ^resampler) -> u64 ---
 

Retrieves the latency introduced by the resampler in input frames.

resampler_get_output_latency ¶

resampler_get_output_latency :: proc "cdecl" (pResampler: ^resampler) -> u64 ---
 

Retrieves the latency introduced by the resampler in output frames.

resampler_get_required_input_frame_count ¶

resampler_get_required_input_frame_count :: proc "cdecl" (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 "cdecl" (pConfig: ^resampler_config, pAllocationCallbacks: ^allocation_callbacks, pResampler: ^resampler) -> result ---
 

Initializes a new resampler object from a config.

resampler_init_preallocated ¶

resampler_init_preallocated :: proc "cdecl" (pConfig: ^resampler_config, pHeap: rawptr, pResampler: ^resampler) -> result ---

resampler_process_pcm_frames ¶

resampler_process_pcm_frames :: proc "cdecl" (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 initilized.

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 ¶

resampler_reset :: proc "cdecl" (pResampler: ^resampler) -> result ---
 

Resets the resampler's timer and clears it's internal cache.

resampler_set_rate ¶

resampler_set_rate :: proc "cdecl" (pResampler: ^resampler, sampleRateIn, sampleRateOut: u32) -> result ---
 

Sets the input and output sample sample rate.

resampler_set_rate_ratio ¶

resampler_set_rate_ratio :: proc "cdecl" (pResampler: ^resampler, ratio: f32) -> result ---
 

Sets the input and output sample rate as a ratio.

The ration is in/out.

resampler_uninit ¶

resampler_uninit :: proc "cdecl" (pResampler: ^resampler, pAllocationCallbacks: ^allocation_callbacks) ---
 

Uninitializes a resampler.

resource_manager_config_init ¶

resource_manager_config_init :: proc "cdecl" () -> resource_manager_config ---

resource_manager_data_buffer_get_available_frames ¶

resource_manager_data_buffer_get_available_frames :: proc "cdecl" (pDataBuffer: ^resource_manager_data_buffer, pCursor: ^u64) -> result ---

resource_manager_data_buffer_get_cursor_in_pcm_frames ¶

resource_manager_data_buffer_get_cursor_in_pcm_frames :: proc "cdecl" (pDataBuffer: ^resource_manager_data_buffer, pCursor: ^u64) -> result ---

resource_manager_data_buffer_get_data_format ¶

resource_manager_data_buffer_get_data_format :: proc "cdecl" (
	pDataBuffer: ^resource_manager_data_buffer, 
	pFormat:     ^format, 
	pChannels:   ^u32, 
	pSampleRate: ^u32, 
	pChannelMap: [^]channel, 
) -> result ---

resource_manager_data_buffer_get_length_in_pcm_frames ¶

resource_manager_data_buffer_get_length_in_pcm_frames :: proc "cdecl" (pDataBuffer: ^resource_manager_data_buffer, pCursor: ^u64) -> result ---

resource_manager_data_buffer_init ¶

resource_manager_data_buffer_init :: proc "cdecl" (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 "cdecl" (pResourceManager: ^resource_manager, pExistingDataBuffer, pDataBuffer: ^resource_manager_data_buffer) -> result ---

resource_manager_data_buffer_init_ex ¶

resource_manager_data_buffer_init_ex :: proc "cdecl" (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 "cdecl" (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 "cdecl" (pDataBuffer: ^resource_manager_data_buffer) -> b32 ---

resource_manager_data_buffer_read_pcm_frames ¶

resource_manager_data_buffer_read_pcm_frames :: proc "cdecl" (pDataBuffer: ^resource_manager_data_buffer, pFramesOut: rawptr, frameCount: u64, pFramesRead: ^u64) -> result ---

resource_manager_data_buffer_result ¶

resource_manager_data_buffer_result :: proc "cdecl" (pDataBuffer: ^resource_manager_data_buffer) -> result ---

resource_manager_data_buffer_seek_to_pcm_frame ¶

resource_manager_data_buffer_seek_to_pcm_frame :: proc "cdecl" (pDataBuffer: ^resource_manager_data_buffer, frameIndex: u64) -> result ---

resource_manager_data_buffer_set_looping ¶

resource_manager_data_buffer_set_looping :: proc "cdecl" (pDataBuffer: ^resource_manager_data_buffer, isLooping: b32) -> result ---

resource_manager_data_buffer_uninit ¶

resource_manager_data_buffer_uninit :: proc "cdecl" (pDataBuffer: ^resource_manager_data_buffer) -> result ---

resource_manager_data_source_config_init ¶

resource_manager_data_source_config_init :: proc "cdecl" () -> resource_manager_data_source_config ---

resource_manager_data_source_get_available_frames ¶

resource_manager_data_source_get_available_frames :: proc "cdecl" (pDataSource: ^resource_manager_data_source, pCursor: ^u64) -> result ---

resource_manager_data_source_get_cursor_in_pcm_frames ¶

resource_manager_data_source_get_cursor_in_pcm_frames :: proc "cdecl" (pDataSource: ^resource_manager_data_source, pCursor: ^u64) -> result ---

resource_manager_data_source_get_data_format ¶

resource_manager_data_source_get_data_format :: proc "cdecl" (
	pDataSource:            ^resource_manager_data_source, 
	pFormat:                ^format, 
	pChannels, pSampleRate: ^u32, 
	pChannelMap:            [^]channel, 
) -> result ---

resource_manager_data_source_get_length_in_pcm_frames ¶

resource_manager_data_source_get_length_in_pcm_frames :: proc "cdecl" (pDataSource: ^resource_manager_data_source, pCursor: ^u64) -> result ---

resource_manager_data_source_init ¶

resource_manager_data_source_init :: proc "cdecl" (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 "cdecl" (pResourceManager: ^resource_manager, pExistingDataSource, pDataSource: ^resource_manager_data_source) -> result ---

resource_manager_data_source_init_ex ¶

resource_manager_data_source_init_ex :: proc "cdecl" (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 "cdecl" (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 "cdecl" (pDataSource: ^resource_manager_data_source) -> b32 ---

resource_manager_data_source_read_pcm_frames ¶

resource_manager_data_source_read_pcm_frames :: proc "cdecl" (pDataSource: ^resource_manager_data_source, pFramesOut: rawptr, frameCount: u64, pFramesRead: ^u64) -> result ---

resource_manager_data_source_result ¶

resource_manager_data_source_result :: proc "cdecl" (pDataSource: ^resource_manager_data_source) -> result ---

resource_manager_data_source_seek_to_pcm_frame ¶

resource_manager_data_source_seek_to_pcm_frame :: proc "cdecl" (pDataSource: ^resource_manager_data_source, frameIndex: u64) -> result ---

resource_manager_data_source_set_looping ¶

resource_manager_data_source_set_looping :: proc "cdecl" (pDataSource: ^resource_manager_data_source, isLooping: b32) -> result ---

resource_manager_data_source_uninit ¶

resource_manager_data_source_uninit :: proc "cdecl" (pDataSource: ^resource_manager_data_source) -> result ---

resource_manager_data_stream_get_available_frames ¶

resource_manager_data_stream_get_available_frames :: proc "cdecl" (pDataStream: ^resource_manager_data_stream, pCursor: ^u64) -> result ---

resource_manager_data_stream_get_cursor_in_pcm_frames ¶

resource_manager_data_stream_get_cursor_in_pcm_frames :: proc "cdecl" (pDataStream: ^resource_manager_data_stream, pCursor: ^u64) -> result ---

resource_manager_data_stream_get_data_format ¶

resource_manager_data_stream_get_data_format :: proc "cdecl" (
	pDataStream:            ^resource_manager_data_stream, 
	pFormat:                ^format, 
	pChannels, pSampleRate: ^u32, 
	pChannelMap:            [^]channel, 
) -> result ---

resource_manager_data_stream_get_length_in_pcm_frames ¶

resource_manager_data_stream_get_length_in_pcm_frames :: proc "cdecl" (pDataStream: ^resource_manager_data_stream, pCursor: ^u64) -> result ---

resource_manager_data_stream_init ¶

resource_manager_data_stream_init :: proc "cdecl" (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 "cdecl" (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 "cdecl" (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 "cdecl" (pDataStream: ^resource_manager_data_stream) -> b32 ---

resource_manager_data_stream_read_pcm_frames ¶

resource_manager_data_stream_read_pcm_frames :: proc "cdecl" (pDataStream: ^resource_manager_data_stream, pFramesOut: rawptr, frameCount: u64, pFramesRead: ^u64) -> result ---

resource_manager_data_stream_result ¶

resource_manager_data_stream_result :: proc "cdecl" (pDataStream: ^resource_manager_data_stream) -> result ---

resource_manager_data_stream_seek_to_pcm_frame ¶

resource_manager_data_stream_seek_to_pcm_frame :: proc "cdecl" (pDataStream: ^resource_manager_data_stream, frameIndex: u64) -> result ---

resource_manager_data_stream_set_looping ¶

resource_manager_data_stream_set_looping :: proc "cdecl" (pDataStream: ^resource_manager_data_stream, isLooping: b32) -> result ---

resource_manager_data_stream_uninit ¶

resource_manager_data_stream_uninit :: proc "cdecl" (pDataStream: ^resource_manager_data_stream) -> result ---

resource_manager_get_log ¶

resource_manager_get_log :: proc "cdecl" (pResourceManager: ^resource_manager) -> ^log ---

resource_manager_init ¶

resource_manager_init :: proc "cdecl" (pConfig: ^resource_manager_config, pResourceManager: ^resource_manager) -> result ---
 

Init.

resource_manager_job_init ¶

resource_manager_job_init :: job_init

resource_manager_job_queue_init ¶

resource_manager_job_queue_init :: job_queue_init

resource_manager_job_queue_next ¶

resource_manager_job_queue_next :: job_queue_next

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 "cdecl" (pResourceManager: ^resource_manager, pJob: ^job) -> result ---

resource_manager_pipeline_notifications_init ¶

resource_manager_pipeline_notifications_init :: proc "cdecl" () -> resource_manager_pipeline_notifications ---

resource_manager_post_job ¶

resource_manager_post_job :: proc "cdecl" (pResourceManager: ^resource_manager, pJob: ^job) -> result ---
 

Job management.

resource_manager_post_job_quit ¶

resource_manager_post_job_quit :: proc "cdecl" (pResourceManager: ^resource_manager) -> result ---

resource_manager_process_job ¶

resource_manager_process_job :: proc "cdecl" (pResourceManager: ^resource_manager, pJob: ^job) -> result ---

resource_manager_process_next_job ¶

resource_manager_process_next_job :: proc "cdecl" (pResourceManager: ^resource_manager) -> result ---

resource_manager_register_decoded_data ¶

resource_manager_register_decoded_data :: proc "cdecl" (
	pResourceManager: ^resource_manager, 
	pName:            cstring, 
	pData:            rawptr, 
	frameCount:       u64, 
	format:           format, 
	channels:         u32, 
) -> result ---

resource_manager_register_decoded_data_w ¶

resource_manager_register_decoded_data_w :: proc "cdecl" (
	pResourceManager: ^resource_manager, 
	pName:            [^]u16, 
	pData:            rawptr, 
	frameCount:       u64, 
	format:           format, 
	channels:         u32, 
) -> result ---

resource_manager_register_encoded_data ¶

resource_manager_register_encoded_data :: proc "cdecl" (pResourceManager: ^resource_manager, pName: cstring, pData: rawptr, sizeInBytes: uint) -> result ---

resource_manager_register_encoded_data_w ¶

resource_manager_register_encoded_data_w :: proc "cdecl" (pResourceManager: ^resource_manager, pName: [^]u16, pData: rawptr, sizeInBytes: uint) -> result ---

resource_manager_register_file ¶

resource_manager_register_file :: proc "cdecl" (pResourceManager: ^resource_manager, pFilePath: cstring, flags: u32) -> result ---
 

Registration.

resource_manager_register_file_w ¶

resource_manager_register_file_w :: proc "cdecl" (pResourceManager: ^resource_manager, pFilePath: [^]u16, flags: u32) -> result ---

resource_manager_uninit ¶

resource_manager_uninit :: proc "cdecl" (pResourceManager: ^resource_manager) ---

resource_manager_unregister_data ¶

resource_manager_unregister_data :: proc "cdecl" (pResourceManager: ^resource_manager, pFilePath: cstring) -> result ---

resource_manager_unregister_data_w ¶

resource_manager_unregister_data_w :: proc "cdecl" (pResourceManager: ^resource_manager, pFilePath: [^]u16) -> result ---

resource_manager_unregister_file ¶

resource_manager_unregister_file :: proc "cdecl" (pResourceManager: ^resource_manager, pFilePath: cstring) -> result ---

resource_manager_unregister_file_w ¶

resource_manager_unregister_file_w :: proc "cdecl" (pResourceManager: ^resource_manager, pFilePath: [^]u16) -> result ---

result_description ¶

result_description :: proc "cdecl" (result: result) -> cstring ---
 

Retrieves a human readable description of the given result code.

silence_pcm_frames ¶

silence_pcm_frames :: proc "cdecl" (p: rawptr, frameCount: u64, format: format, channels: u32) ---
 

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 "cdecl" (pAllocator: ^slot_allocator, pSlot: ^u64) -> result ---

slot_allocator_config_init ¶

slot_allocator_config_init :: proc "cdecl" (capacity: u32) -> slot_allocator_config ---

slot_allocator_free ¶

slot_allocator_free :: proc "cdecl" (pAllocator: ^slot_allocator, slot: u64) -> result ---

slot_allocator_get_heap_size ¶

slot_allocator_get_heap_size :: proc "cdecl" (pConfig: ^slot_allocator_config, pHeapSizeInBytes: ^uint) -> result ---

slot_allocator_init ¶

slot_allocator_init :: proc "cdecl" (pConfig: ^slot_allocator_config, pAllocationCallbacks: ^allocation_callbacks, pAllocator: ^slot_allocator) -> result ---

slot_allocator_init_preallocated ¶

slot_allocator_init_preallocated :: proc "cdecl" (pConfig: ^slot_allocator_config, pHeap: rawptr, pAllocator: ^slot_allocator) -> result ---

slot_allocator_uninit ¶

slot_allocator_uninit :: proc "cdecl" (pAllocator: ^slot_allocator, pAllocationCallbacks: ^allocation_callbacks) ---

sound_at_end ¶

sound_at_end :: proc "cdecl" (pSound: ^sound) -> b32 ---

sound_config_init ¶

sound_config_init :: proc "cdecl" () -> sound_config ---

sound_get_attenuation_model ¶

sound_get_attenuation_model :: proc "cdecl" (pSound: ^sound) -> attenuation_model ---

sound_get_cone ¶

sound_get_cone :: proc "cdecl" (pSound: ^sound, pInnerAngleInRadians, pOuterAngleInRadians, pOuterGain: ^f32) ---

sound_get_current_fade_volume ¶

sound_get_current_fade_volume :: proc "cdecl" (pSound: ^sound) -> f32 ---

sound_get_cursor_in_pcm_frames ¶

sound_get_cursor_in_pcm_frames :: proc "cdecl" (pSound: ^sound, pCursor: ^u64) -> result ---

sound_get_cursor_in_seconds ¶

sound_get_cursor_in_seconds :: proc "cdecl" (pSound: ^sound, pCursor: ^f32) -> result ---

sound_get_data_format ¶

sound_get_data_format :: proc "cdecl" (
	pSound:                 ^sound, 
	pFormat:                ^format, 
	pChannels, pSampleRate: ^u32, 
	pChannelMap:            ^channel, 
) -> result ---

sound_get_data_source ¶

sound_get_data_source :: proc "cdecl" (pSound: ^sound) -> ^data_source ---

sound_get_direction ¶

sound_get_direction :: proc "cdecl" (pSound: ^sound) -> vec3f ---

sound_get_direction_to_listener ¶

sound_get_direction_to_listener :: proc "cdecl" (pSound: ^sound) -> vec3f ---

sound_get_directional_attenuation_factor ¶

sound_get_directional_attenuation_factor :: proc "cdecl" (pSound: ^sound) -> f32 ---

sound_get_doppler_factor ¶

sound_get_doppler_factor :: proc "cdecl" (pSound: ^sound) -> f32 ---

sound_get_engine ¶

sound_get_engine :: proc "cdecl" (pSound: ^sound) -> ^engine ---

sound_get_length_in_pcm_frames ¶

sound_get_length_in_pcm_frames :: proc "cdecl" (pSound: ^sound, pCursor: ^u64) -> result ---

sound_get_length_in_seconds ¶

sound_get_length_in_seconds :: proc "cdecl" (pSound: ^sound, pCursor: ^f32) -> result ---

sound_get_listener_index ¶

sound_get_listener_index :: proc "cdecl" (pSound: ^sound) -> u32 ---

sound_get_max_distance ¶

sound_get_max_distance :: proc "cdecl" (pSound: ^sound) -> f32 ---

sound_get_max_gain ¶

sound_get_max_gain :: proc "cdecl" (pSound: ^sound) -> f32 ---

sound_get_min_distance ¶

sound_get_min_distance :: proc "cdecl" (pSound: ^sound) -> f32 ---

sound_get_min_gain ¶

sound_get_min_gain :: proc "cdecl" (pSound: ^sound) -> f32 ---

sound_get_pan ¶

sound_get_pan :: proc "cdecl" (pSound: ^sound) -> f32 ---

sound_get_pan_mode ¶

sound_get_pan_mode :: proc "cdecl" (pSound: ^sound) -> pan_mode ---

sound_get_pinned_listener_index ¶

sound_get_pinned_listener_index :: proc "cdecl" (pSound: ^sound) -> u32 ---

sound_get_pitch ¶

sound_get_pitch :: proc "cdecl" (pSound: ^sound) -> f32 ---

sound_get_position ¶

sound_get_position :: proc "cdecl" (pSound: ^sound) -> vec3f ---

sound_get_positioning ¶

sound_get_positioning :: proc "cdecl" (pSound: ^sound) -> positioning ---

sound_get_rolloff ¶

sound_get_rolloff :: proc "cdecl" (pSound: ^sound) -> f32 ---

sound_get_time_in_pcm_frames ¶

sound_get_time_in_pcm_frames :: proc "cdecl" (pSound: ^sound) -> u64 ---

sound_get_velocity ¶

sound_get_velocity :: proc "cdecl" (pSound: ^sound) -> vec3f ---

sound_get_volume ¶

sound_get_volume :: proc "cdecl" (pSound: ^sound) -> f32 ---

sound_group_config_init ¶

sound_group_config_init :: proc "cdecl" () -> sound_group_config ---

sound_group_get_attenuation_model ¶

sound_group_get_attenuation_model :: proc "cdecl" (pGroup: ^sound_group) -> attenuation_model ---

sound_group_get_cone ¶

sound_group_get_cone :: proc "cdecl" (pGroup: ^sound_group, pInnerAngleInRadians, pOuterAngleInRadians, pOuterGain: ^f32) ---

sound_group_get_current_fade_volume ¶

sound_group_get_current_fade_volume :: proc "cdecl" (pGroup: ^sound_group) -> f32 ---

sound_group_get_direction ¶

sound_group_get_direction :: proc "cdecl" (pGroup: ^sound_group) -> vec3f ---

sound_group_get_direction_to_listener ¶

sound_group_get_direction_to_listener :: proc "cdecl" (pGroup: ^sound_group) -> vec3f ---

sound_group_get_directional_attenuation_factor ¶

sound_group_get_directional_attenuation_factor :: proc "cdecl" (pGroup: ^sound_group) -> f32 ---

sound_group_get_doppler_factor ¶

sound_group_get_doppler_factor :: proc "cdecl" (pGroup: ^sound_group) -> f32 ---

sound_group_get_engine ¶

sound_group_get_engine :: proc "cdecl" (pGroup: ^sound_group) -> ^engine ---

sound_group_get_listener_index ¶

sound_group_get_listener_index :: proc "cdecl" (pGroup: ^sound_group) -> u32 ---

sound_group_get_max_distance ¶

sound_group_get_max_distance :: proc "cdecl" (pGroup: ^sound_group) -> f32 ---

sound_group_get_max_gain ¶

sound_group_get_max_gain :: proc "cdecl" (pGroup: ^sound_group) -> f32 ---

sound_group_get_min_distance ¶

sound_group_get_min_distance :: proc "cdecl" (pGroup: ^sound_group) -> f32 ---

sound_group_get_min_gain ¶

sound_group_get_min_gain :: proc "cdecl" (pGroup: ^sound_group) -> f32 ---

sound_group_get_pan ¶

sound_group_get_pan :: proc "cdecl" (pGroup: ^sound_group) -> f32 ---

sound_group_get_pan_mode ¶

sound_group_get_pan_mode :: proc "cdecl" (pGroup: ^sound_group) -> pan_mode ---

sound_group_get_pinned_listener_index ¶

sound_group_get_pinned_listener_index :: proc "cdecl" (pGroup: ^sound_group) -> u32 ---

sound_group_get_pitch ¶

sound_group_get_pitch :: proc "cdecl" (pGroup: ^sound_group) -> f32 ---

sound_group_get_position ¶

sound_group_get_position :: proc "cdecl" (pGroup: ^sound_group) -> vec3f ---

sound_group_get_positioning ¶

sound_group_get_positioning :: proc "cdecl" (pGroup: ^sound_group) -> positioning ---

sound_group_get_rolloff ¶

sound_group_get_rolloff :: proc "cdecl" (pGroup: ^sound_group) -> f32 ---

sound_group_get_time_in_pcm_frames ¶

sound_group_get_time_in_pcm_frames :: proc "cdecl" (pGroup: ^sound_group) -> u64 ---

sound_group_get_velocity ¶

sound_group_get_velocity :: proc "cdecl" (pGroup: ^sound_group) -> vec3f ---

sound_group_get_volume ¶

sound_group_get_volume :: proc "cdecl" (pGroup: ^sound_group) -> f32 ---

sound_group_init ¶

sound_group_init :: proc "cdecl" (pEngine: ^engine, flags: u32, pParentGroup, pGroup: ^sound_group) -> result ---

sound_group_init_ex ¶

sound_group_init_ex :: proc "cdecl" (pEngine: ^engine, pConfig: ^sound_group_config, pGroup: ^sound_group) -> result ---

sound_group_is_playing ¶

sound_group_is_playing :: proc "cdecl" (pGroup: ^sound_group) -> b32 ---

sound_group_is_spatialization_enabled ¶

sound_group_is_spatialization_enabled :: proc "cdecl" (pGroup: ^sound_group) -> b32 ---

sound_group_set_attenuation_model ¶

sound_group_set_attenuation_model :: proc "cdecl" (pGroup: ^sound_group, attenuationModel: attenuation_model) ---

sound_group_set_cone ¶

sound_group_set_cone :: proc "cdecl" (pGroup: ^sound_group, x, y, z: f32) ---

sound_group_set_direction ¶

sound_group_set_direction :: proc "cdecl" (pGroup: ^sound_group, x, y, z: f32) ---

sound_group_set_directional_attenuation_factor ¶

sound_group_set_directional_attenuation_factor :: proc "cdecl" (pGroup: ^sound_group, volume: f32) ---

sound_group_set_doppler_factor ¶

sound_group_set_doppler_factor :: proc "cdecl" (pGroup: ^sound_group, volume: f32) ---

sound_group_set_fade_in_milliseconds ¶

sound_group_set_fade_in_milliseconds :: proc "cdecl" (pGroup: ^sound_group, volumeBeg, volumeEnd: f32, fadeLengthInFrames: u64) ---

sound_group_set_fade_in_pcm_frames ¶

sound_group_set_fade_in_pcm_frames :: proc "cdecl" (pGroup: ^sound_group, volumeBeg, volumeEnd: f32, fadeLengthInFrames: u64) ---

sound_group_set_max_distance ¶

sound_group_set_max_distance :: proc "cdecl" (pGroup: ^sound_group, volume: f32) ---

sound_group_set_max_gain ¶

sound_group_set_max_gain :: proc "cdecl" (pGroup: ^sound_group, volume: f32) ---

sound_group_set_min_distance ¶

sound_group_set_min_distance :: proc "cdecl" (pGroup: ^sound_group, volume: f32) ---

sound_group_set_min_gain ¶

sound_group_set_min_gain :: proc "cdecl" (pGroup: ^sound_group, volume: f32) ---

sound_group_set_pan ¶

sound_group_set_pan :: proc "cdecl" (pGroup: ^sound_group, volume: f32) ---

sound_group_set_pan_mode ¶

sound_group_set_pan_mode :: proc "cdecl" (pGroup: ^sound_group, panMode: pan_mode) ---

sound_group_set_pinned_listener_index ¶

sound_group_set_pinned_listener_index :: proc "cdecl" (pGroup: ^sound_group, listenerIndex: u32) ---

sound_group_set_pitch ¶

sound_group_set_pitch :: proc "cdecl" (pGroup: ^sound_group, volume: f32) ---

sound_group_set_position ¶

sound_group_set_position :: proc "cdecl" (pGroup: ^sound_group, x, y, z: f32) ---

sound_group_set_positioning ¶

sound_group_set_positioning :: proc "cdecl" (pGroup: ^sound_group, positioning: positioning) ---

sound_group_set_rolloff ¶

sound_group_set_rolloff :: proc "cdecl" (pGroup: ^sound_group, volume: f32) ---

sound_group_set_spatialization_enabled ¶

sound_group_set_spatialization_enabled :: proc "cdecl" (pGroup: ^sound_group, enabled: b32) ---

sound_group_set_start_time_in_milliseconds ¶

sound_group_set_start_time_in_milliseconds :: proc "cdecl" (pGroup: ^sound_group, absoluteGlobalTimeInFrames: u64) ---

sound_group_set_start_time_in_pcm_frames ¶

sound_group_set_start_time_in_pcm_frames :: proc "cdecl" (pGroup: ^sound_group, absoluteGlobalTimeInFrames: u64) ---

sound_group_set_stop_time_in_milliseconds ¶

sound_group_set_stop_time_in_milliseconds :: proc "cdecl" (pGroup: ^sound_group, absoluteGlobalTimeInFrames: u64) ---

sound_group_set_stop_time_in_pcm_frames ¶

sound_group_set_stop_time_in_pcm_frames :: proc "cdecl" (pGroup: ^sound_group, absoluteGlobalTimeInFrames: u64) ---

sound_group_set_velocity ¶

sound_group_set_velocity :: proc "cdecl" (pGroup: ^sound_group, x, y, z: f32) ---

sound_group_set_volume ¶

sound_group_set_volume :: proc "cdecl" (pGroup: ^sound_group, volume: f32) ---

sound_group_start ¶

sound_group_start :: proc "cdecl" (pGroup: ^sound_group) -> result ---

sound_group_stop ¶

sound_group_stop :: proc "cdecl" (pGroup: ^sound_group) -> result ---

sound_group_uninit ¶

sound_group_uninit :: proc "cdecl" (pGroup: ^sound_group) ---

sound_init_copy ¶

sound_init_copy :: proc "cdecl" (pEngine: ^engine, pExistingSound: ^sound, flags: u32, pGroup: ^sound_group, pSound: ^sound) -> result ---

sound_init_ex ¶

sound_init_ex :: proc "cdecl" (pEngine: ^engine, pConfig: ^sound_config, pSound: ^sound) -> result ---

sound_init_from_data_source ¶

sound_init_from_data_source :: proc "cdecl" (pEngine: ^engine, pDataSource: ^data_source, flags: u32, pGroup: ^sound_group, pSound: ^sound) -> result ---

sound_init_from_file ¶

sound_init_from_file :: proc "cdecl" (
	pEngine:    ^engine, 
	pFilePath:  cstring, 
	flags:      u32, 
	pGroup:     ^sound_group, 
	pDoneFence: ^fence, 
) -> result ---

sound_init_from_file_w ¶

sound_init_from_file_w :: proc "cdecl" (
	pEngine:    ^engine, 
	pFilePath:  [^]u16, 
	flags:      u32, 
	pGroup:     ^sound_group, 
	pDoneFence: ^fence, 
) -> result ---

sound_is_looping ¶

sound_is_looping :: proc "cdecl" (pSound: ^sound) -> b32 ---

sound_is_playing ¶

sound_is_playing :: proc "cdecl" (pSound: ^sound) -> b32 ---

sound_is_spatialization_enabled ¶

sound_is_spatialization_enabled :: proc "cdecl" (pSound: ^sound) -> b32 ---

sound_seek_to_pcm_frame ¶

sound_seek_to_pcm_frame :: proc "cdecl" (pSound: ^sound, frameIndex: u64) -> result ---

sound_set_attenuation_model ¶

sound_set_attenuation_model :: proc "cdecl" (pSound: ^sound, attenuationModel: attenuation_model) ---

sound_set_cone ¶

sound_set_cone :: proc "cdecl" (pSound: ^sound, x, y, z: f32) ---

sound_set_direction ¶

sound_set_direction :: proc "cdecl" (pSound: ^sound, x, y, z: f32) ---

sound_set_directional_attenuation_factor ¶

sound_set_directional_attenuation_factor :: proc "cdecl" (pSound: ^sound, volume: f32) ---

sound_set_doppler_factor ¶

sound_set_doppler_factor :: proc "cdecl" (pSound: ^sound, volume: f32) ---

sound_set_fade_in_milliseconds ¶

sound_set_fade_in_milliseconds :: proc "cdecl" (pSound: ^sound, volumeBeg, volumeEnd: f32, fadeLengthInFrames: u64) ---

sound_set_fade_in_pcm_frames ¶

sound_set_fade_in_pcm_frames :: proc "cdecl" (pSound: ^sound, volumeBeg, volumeEnd: f32, fadeLengthInFrames: u64) ---

sound_set_looping ¶

sound_set_looping :: proc "cdecl" (pSound: ^sound, enabled: b32) ---

sound_set_max_distance ¶

sound_set_max_distance :: proc "cdecl" (pSound: ^sound, volume: f32) ---

sound_set_max_gain ¶

sound_set_max_gain :: proc "cdecl" (pSound: ^sound, volume: f32) ---

sound_set_min_distance ¶

sound_set_min_distance :: proc "cdecl" (pSound: ^sound, volume: f32) ---

sound_set_min_gain ¶

sound_set_min_gain :: proc "cdecl" (pSound: ^sound, volume: f32) ---

sound_set_pan ¶

sound_set_pan :: proc "cdecl" (pSound: ^sound, volume: f32) ---

sound_set_pan_mode ¶

sound_set_pan_mode :: proc "cdecl" (pSound: ^sound, panMode: pan_mode) ---

sound_set_pinned_listener_index ¶

sound_set_pinned_listener_index :: proc "cdecl" (pSound: ^sound, listenerIndex: u32) ---

sound_set_pitch ¶

sound_set_pitch :: proc "cdecl" (pSound: ^sound, volume: f32) ---

sound_set_position ¶

sound_set_position :: proc "cdecl" (pSound: ^sound, x, y, z: f32) ---

sound_set_positioning ¶

sound_set_positioning :: proc "cdecl" (pSound: ^sound, positioning: positioning) ---

sound_set_rolloff ¶

sound_set_rolloff :: proc "cdecl" (pSound: ^sound, volume: f32) ---

sound_set_spatialization_enabled ¶

sound_set_spatialization_enabled :: proc "cdecl" (pSound: ^sound, enabled: b32) ---

sound_set_start_time_in_milliseconds ¶

sound_set_start_time_in_milliseconds :: proc "cdecl" (pSound: ^sound, absoluteGlobalTimeInFrames: u64) ---

sound_set_start_time_in_pcm_frames ¶

sound_set_start_time_in_pcm_frames :: proc "cdecl" (pSound: ^sound, absoluteGlobalTimeInFrames: u64) ---

sound_set_stop_time_in_milliseconds ¶

sound_set_stop_time_in_milliseconds :: proc "cdecl" (pSound: ^sound, absoluteGlobalTimeInFrames: u64) ---

sound_set_stop_time_in_pcm_frames ¶

sound_set_stop_time_in_pcm_frames :: proc "cdecl" (pSound: ^sound, absoluteGlobalTimeInFrames: u64) ---

sound_set_velocity ¶

sound_set_velocity :: proc "cdecl" (pSound: ^sound, x, y, z: f32) ---

sound_set_volume ¶

sound_set_volume :: proc "cdecl" (pSound: ^sound, volume: f32) ---

sound_start ¶

sound_start :: proc "cdecl" (pSound: ^sound) -> result ---

sound_stop ¶

sound_stop :: proc "cdecl" (pSound: ^sound) -> result ---

sound_uninit ¶

sound_uninit :: proc "cdecl" (pSound: ^sound) ---

spatializer_config_init ¶

spatializer_config_init :: proc "cdecl" (channelsIn, channelsOut: u32) -> spatializer_config ---

spatializer_get_attenuation_model ¶

spatializer_get_attenuation_model :: proc "cdecl" (pSpatializer: ^spatializer) -> attenuation_model ---

spatializer_get_cone ¶

spatializer_get_cone :: proc "cdecl" (pSpatializer: ^spatializer, pInnerAngleInRadians, pOuterAngleInRadians, pOuterGain: ^f32) ---

spatializer_get_direction ¶

spatializer_get_direction :: proc "cdecl" (pSpatializer: ^spatializer) -> vec3f ---

spatializer_get_directional_attenuation_factor ¶

spatializer_get_directional_attenuation_factor :: proc "cdecl" (pSpatializer: ^spatializer) -> f32 ---

spatializer_get_doppler_factor ¶

spatializer_get_doppler_factor :: proc "cdecl" (pSpatializer: ^spatializer) -> f32 ---

spatializer_get_heap_size ¶

spatializer_get_heap_size :: proc "cdecl" (pConfig: ^spatializer_config, pHeapSizeInBytes: ^uint) -> result ---