package vendor:windows/XAudio2

⌘K
Ctrl+K
or
/

    Overview

    Bindings for Windows XAudio2.

    Compiling for Windows 10 RS5 (1809) and later

    Index

    Types (80)
    Constants (166)
    Variables (43)
    Procedure Groups (0)

    This section is empty.

    Types

    AUDIO_STREAM_CATEGORY ¶

    AUDIO_STREAM_CATEGORY :: enum i32 {
    	Other          = 0, 
    	// ForegroundOnlyMedia = 1,
    	// BackgroundCapableMedia = 2,
    	Communications = 3, 
    	Alerts         = 4, 
    	SoundEffects   = 5, 
    	GameEffects    = 6, 
    	GameMedia      = 7, 
    	GameChat       = 8, 
    	Speech         = 9, 
    	Movie          = 10, 
    	Media          = 11, 
    	FarFieldSpeech = 12, 
    	UniformSpeech  = 13, 
    	VoiceTyping    = 14, 
    }
     

    ------------------------------------------------------------------------- Description: Audio stream categories

    Other - All other streams (default) ForegroundOnlyMedia - (deprecated for Win10) Music, Streaming audio BackgroundCapableMedia - (deprecated for Win10) Video with audio Communications - VOIP, chat, phone call Alerts - Alarm, Ring tones SoundEffects - Sound effects, clicks, dings GameEffects - Game sound effects GameMedia - Background audio for games GameChat - In game player chat Speech - Speech recognition Media - Music, Streaming audio Movie - Video with audio FarFieldSpeech - Capture of far field speech UniformSpeech - Uniform, device agnostic speech processing VoiceTyping - Dictation, typing by voice

    BUFFER ¶

    BUFFER :: struct #packed {
    	Flags:      FLAGS,
    	// Either 0 or END_OF_STREAM.
    	AudioBytes: u32,
    	// Size of the audio data buffer in bytes.
    	pAudioData: [^]u8 `fmt:"v,AudioBytes"`,
    	// Pointer to the audio data buffer.
    	PlayBegin:  u32,
    	// First sample in this buffer to be played.
    	PlayLength: u32,
    	// Length of the region to be played in samples, or 0 to play the whole buffer.
    	LoopBegin:  u32,
    	// First sample of the region to be looped.
    	LoopLength: u32,
    	// Length of the desired loop region in samples, or 0 to loop the entire buffer.
    	LoopCount:  u32,
    	// Number of times to repeat the loop region, or LOOP_INFINITE to loop forever.
    	pContext:   rawptr,
    }
     

    Used in IXAudio2SourceVoice.SubmitSourceBuffer

    BUFFER_WMA ¶

    BUFFER_WMA :: struct #packed {
    	pDecodedPacketCumulativeBytes: [^]u32 `fmt:"v,PacketCount"`,
    	// Decoded packet's cumulative size array. Each element is the number of bytes accumulated when the corresponding XWMA packet is decoded in order.  The array must have PacketCount elements.
    	PacketCount:                   u32,
    }
     

    Used in IXAudio2SourceVoice.SubmitSourceBuffer when submitting XWMA data. NOTE: If an XWMA sound is submitted in more than one buffer, each buffer's pDecodedPacketCumulativeBytes[PacketCount-1] value must be subtracted from all the entries in the next buffer's pDecodedPacketCumulativeBytes array. And whether a sound is submitted in more than one buffer or not, the final buffer of the sound should use the END_OF_STREAM flag, or else the client must call IXAudio2SourceVoice.Discontinuity after submitting it.

    CALCULATE_FLAG ¶

    CALCULATE_FLAG :: enum u32 {
    	MATRIX          = 0,  // enable matrix coefficient table calculation
    	DELAY           = 1,  // enable delay time array calculation (stereo final mix only)
    	LPF_DIRECT      = 2,  // enable LPF direct-path coefficient calculation
    	LPF_REVERB      = 3,  // enable LPF reverb-path coefficient calculation
    	REVERB          = 4,  // enable reverb send level calculation
    	DOPPLER         = 5,  // enable doppler shift factor calculation
    	EMITTER_ANGLE   = 6,  // enable emitter-to-listener interior angle calculation
    	ZEROCENTER      = 16, // do not position to front center speaker, signal positioned to remaining speakers instead, front center destination channel will be zero in returned matrix coefficient table, valid only for matrix calculations with final mix formats that have a front center channel
    	REDIRECT_TO_LFE = 17, // apply equal mix of all source channels to LFE destination channel, valid only for matrix calculations with sources that have no LFE channel and final mix formats that have an LFE channel
    }

    CALCULATE_FLAGS ¶

    CALCULATE_FLAGS :: distinct bit_set[CALCULATE_FLAG; u32]
     

    calculation control flags, used with Calculate

    Related Procedures With Parameters

    CONE ¶

    CONE :: struct #packed {
    	InnerAngle:  f32,
    	// inner cone angle in radians, must be within [0.0, TAU]
    	OuterAngle:  f32,
    	// outer cone angle in radians, must be within [InnerAngle, TAU]
    	InnerVolume: f32,
    	// volume level scaler on/within inner cone, used only for matrix calculations, must be within [0.0, 2.0] when used
    	OuterVolume: f32,
    	// volume level scaler on/beyond outer cone, used only for matrix calculations, must be within [0.0, 2.0] when used
    	InnerLPF:    f32,
    	// LPF (both direct and reverb paths) coefficient subtrahend on/within inner cone, used only for LPF (both direct and reverb paths) calculations, must be within [0.0, 1.0] when used
    	OuterLPF:    f32,
    	// LPF (both direct and reverb paths) coefficient subtrahend on/beyond outer cone, used only for LPF (both direct and reverb paths) calculations, must be within [0.0, 1.0] when used
    	InnerReverb: f32,
    	// reverb send level scaler on/within inner cone, used only for reverb calculations, must be within [0.0, 2.0] when used
    	OuterReverb: f32,
    }
     

    Cone: Specifies directionality for a listener or single-channel emitter by modifying DSP behaviour with respect to its front orientation. This is modeled using two sound cones: an inner cone and an outer cone. On/within the inner cone, DSP settings are scaled by the inner values. On/beyond the outer cone, DSP settings are scaled by the outer values. If on both the cones, DSP settings are scaled by the inner values only. Between the two cones, the scaler is linearly interpolated between the inner and outer values. Set both cone angles to 0 or TAU for omnidirectionality using only the outer or inner values respectively.

    DEBUG_CONFIGURATION ¶

    DEBUG_CONFIGURATION :: struct #packed {
    	TraceMask:       DEBUG_CONFIG_FLAGS,
    	// Bitmap of enabled debug message types.
    	BreakMask:       DEBUG_CONFIG_FLAGS,
    	// Message types that will break into the debugger.
    	LogThreadID:     b32,
    	// Whether to log the thread ID with each message.
    	LogFileline:     b32,
    	// Whether to log the source file and line number.
    	LogFunctionName: b32,
    	// Whether to log the function name.
    	LogTiming:       b32,
    }
     

    Used in IXAudio2.SetDebugConfiguration

    DEBUG_CONFIG_FLAG ¶

    DEBUG_CONFIG_FLAG :: enum u32 {
    	ERRORS     = 0,  // For handled errors with serious effects.
    	WARNINGS   = 1,  // For handled errors that may be recoverable.
    	INFO       = 2,  // Informational chit-chat (e.g. state changes).
    	DETAIL     = 3,  // More detailed chit-chat.
    	API_CALLS  = 4,  // Public API function entries and exits.
    	FUNC_CALLS = 5,  // Internal function entries and exits.
    	TIMING     = 6,  // Delays detected and other timing data.
    	LOCKS      = 7,  // Usage of critical sections and mutexes.
    	MEMORY     = 8,  // Memory heap usage information.
    	STREAMING  = 12, // Audio streaming information.
    }

    DEBUG_CONFIG_FLAGS ¶

    DEBUG_CONFIG_FLAGS :: distinct bit_set[DEBUG_CONFIG_FLAG; u32]
     

    Values for the TraceMask and BreakMask bitmaps. Only ERRORS and WARNINGS are valid in BreakMask. WARNINGS implies ERRORS, DETAIL implies INFO, and FUNC_CALLS implies API_CALLS. By default, TraceMask is ERRORS and WARNINGS and all the other settings are zero.

    DISTANCE_CURVE ¶

    DISTANCE_CURVE :: struct #packed {
    	pPoints:    [^]DISTANCE_CURVE_POINT `fmt:"v,PointCount"`,
    	// distance curve point array, must have at least PointCount elements with no duplicates and be sorted in ascending order with respect to Distance
    	PointCount: u32,
    }
     

    Distance curve: A piecewise curve made up of linear segments used to define DSP behaviour with respect to normalized distance.

    Note that curve point distances are normalized within [0.0, 1.0]. EMITTER.CurveDistanceScaler must be used to scale the normalized distances to user-defined world units. For distances beyond CurveDistanceScaler * 1.0, pPoints[PointCount-1].DSPSetting is used as the DSP setting.

    All distance curve spans must be such that: pPoints[k-1].DSPSetting + ((pPoints[k].DSPSetting-pPoints[k-1].DSPSetting) / (pPoints[k].Distance-pPoints[k-1].Distance)) * (pPoints[k].Distance-pPoints[k-1].Distance) != NAN or infinite values For all points in the distance curve where 1 <= k < PointCount.

    DISTANCE_CURVE_POINT ¶

    DISTANCE_CURVE_POINT :: struct #packed {
    	Distance:   f32,
    	// normalized distance, must be within [0.0, 1.0]
    	DSPSetting: f32,
    }
     

    Distance curve point: Defines a DSP setting at a given normalized distance.

    DSP_SETTINGS ¶

    DSP_SETTINGS :: struct #packed {
    	pMatrixCoefficients:       [^]f32,
    	// [inout] matrix coefficient table, receives an array representing the volume level used to send from source channel S to destination channel D, stored as pMatrixCoefficients[SrcChannelCount * D + S], must have at least SrcChannelCount*DstChannelCount elements
    	pDelayTimes:               [^]f32,
    	// [inout] delay time array, receives delays for each destination channel in milliseconds, must have at least DstChannelCount elements (stereo final mix only)
    	SrcChannelCount:           u32,
    	// [in] number of source channels, must equal number of channels in respective emitter
    	DstChannelCount:           u32,
    	// [in] number of destination channels, must equal number of channels of the final mix
    	LPFDirectCoefficient:      f32,
    	// [out] LPF direct-path coefficient
    	LPFReverbCoefficient:      f32,
    	// [out] LPF reverb-path coefficient
    	ReverbLevel:               f32,
    	// [out] reverb send level
    	DopplerFactor:             f32,
    	// [out] doppler shift factor, scales resampler ratio for doppler shift effect, where the effective frequency = DopplerFactor * original frequency
    	EmitterToListenerAngle:    f32,
    	// [out] emitter-to-listener interior angle, expressed in radians with respect to the emitter's front orientation
    	EmitterToListenerDistance: f32,
    	// [out] distance in user-defined world units from the emitter base to listener position, always calculated
    	EmitterVelocityComponent:  f32,
    	// [out] component of emitter velocity vector projected onto emitter->listener vector in user-defined world units/second, calculated only for doppler
    	ListenerVelocityComponent: f32,
    }
     

    DSP settings: Receives results from a call to Calculate to be sent to the low-level audio rendering API for 3D signal processing. The user is responsible for allocating the matrix coefficient table, delay time array, and initializing the channel counts when used.

    Related Procedures With Parameters

    EFFECT_CHAIN ¶

    EFFECT_CHAIN :: struct #packed {
    	EffectCount:        u32,
    	// Number of effects in this voice's effect chain.
    	pEffectDescriptors: [^]EFFECT_DESCRIPTOR `fmt:"v,EffectCount"`,
    }
     

    Used in the voice creation functions and in IXAudio2Voice.SetEffectChain

    EFFECT_DESCRIPTOR ¶

    EFFECT_DESCRIPTOR :: struct #packed {
    	pEffect:        ^sys_windows.IUnknown,
    	// Pointer to the effect object's IUnknown interface.
    	InitialState:   b32,
    	// TRUE if the effect should begin in the enabled state.
    	OutputChannels: u32,
    }
     

    Used in EFFECT_CHAIN below

    EMITTER ¶

    EMITTER :: struct #packed {
    	pCone:               ^CONE,
    	// sound cone, used only with single-channel emitters for matrix, LPF (both direct and reverb paths), and reverb calculations, nil specifies omnidirectionality
    	OrientFront:         VECTOR,
    	// orientation of front direction, used only for emitter angle calculations or with multi-channel emitters for matrix calculations or single-channel emitters with cones for matrix, LPF (both direct and reverb paths), and reverb calculations, must be normalized when used
    	OrientTop:           VECTOR,
    	// orientation of top direction, used only with multi-channel emitters for matrix calculations, must be orthonormal with OrientFront when used
    	Position:            VECTOR,
    	// position in user-defined world units, does not affect Velocity
    	Velocity:            VECTOR,
    	// velocity vector in user-defined world units/second, used only for doppler calculations, does not affect Position
    	InnerRadius:         f32,
    	// inner radius, must be within [0.0, max(f32)]
    	InnerRadiusAngle:    f32,
    	// inner radius angle, must be within [0.0, PI/4.0)
    	ChannelCount:        u32,
    	// number of sound channels, must be > 0
    	ChannelRadius:       f32,
    	// channel radius, used only with multi-channel emitters for matrix calculations, must be >= 0.0 when used
    	pChannelAzimuths:    [^]f32 `fmt:"v,ChannelCount"`,
    	// channel azimuth array, used only with multi-channel emitters for matrix calculations, contains positions of each channel expressed in radians along the channel radius with respect to the front orientation vector in the plane orthogonal to the top orientation vector, or TAU to specify an LFE channel, must have at least ChannelCount elements, all within [0.0, TAU] when used
    	pVolumeCurve:        ^DISTANCE_CURVE,
    	// volume level distance curve, used only for matrix calculations, nil specifies a default curve that conforms to the inverse square law, calculated in user-defined world units with distances <= CurveDistanceScaler clamped to no attenuation
    	pLFECurve:           ^DISTANCE_CURVE,
    	// LFE level distance curve, used only for matrix calculations, nil specifies a default curve that conforms to the inverse square law, calculated in user-defined world units with distances <= CurveDistanceScaler clamped to no attenuation
    	pLPFDirectCurve:     ^DISTANCE_CURVE,
    	// LPF direct-path coefficient distance curve, used only for LPF direct-path calculations, nil specifies the default curve: [0.0,1.0], [1.0,0.75]
    	pLPFReverbCurve:     ^DISTANCE_CURVE,
    	// LPF reverb-path coefficient distance curve, used only for LPF reverb-path calculations, nil specifies the default curve: [0.0,0.75], [1.0,0.75]
    	pReverbCurve:        ^DISTANCE_CURVE,
    	// reverb send level distance curve, used only for reverb calculations, nil specifies the default curve: [0.0,1.0], [1.0,0.0]
    	CurveDistanceScaler: f32,
    	// curve distance scaler, used to scale normalized distance curves to user-defined world units and/or exaggerate their effect, used only for matrix, LPF (both direct and reverb paths), and reverb calculations, must be within [min(f32), max(f32)] when used
    	DopplerScaler:       f32,
    }
     

    Emitter: Defines a 3D audio source, divided into two classifications: Single-point -- For use with single-channel sounds. Positioned at the emitter base, i.e. the channel radius and azimuth are ignored if the number of channels == 1. May be omnidirectional or directional using a cone. The cone originates from the emitter base position, and is directed by the emitter's front orientation. Multi-point -- For use with multi-channel sounds. Each non-LFE channel is positioned using an azimuth along the channel radius with respect to the front orientation vector in the plane orthogonal to the top orientation vector. An azimuth of TAU specifies a channel is an LFE. Such channels are positioned at the emitter base and are calculated with respect to pLFECurve only, never pVolumeCurve. Multi-point emitters are always omnidirectional, i.e. the cone is ignored if the number of channels > 1. Note that many properties are shared among all channel points, locking certain behaviour with respect to the emitter base position. For example, doppler shift is always calculated with respect to the emitter base position and so is constant for all its channel points. Distance curve calculations are also with respect to the emitter base position, with the curves being calculated independently of each other. For instance, volume and LFE calculations do not affect one another.

    Related Procedures With Parameters

    FILTER_PARAMETERS ¶

    FILTER_PARAMETERS :: struct #packed {
    	Type:      FILTER_TYPE,
    	// Filter type.
    	Frequency: f32,
    	// Filter coefficient. Must be >= 0 and <= MAX_FILTER_FREQUENCY. See CutoffFrequencyToRadians() for state-variable filter types and CutoffFrequencyToOnePoleCoefficient() for one-pole filter types.
    	OneOverQ:  f32,
    }
     

    Used in IXAudio2Voice.Set/GetFilterParameters and Set/GetOutputFilterParameters

    FILTER_TYPE ¶

    FILTER_TYPE :: HrtfOrientation
     

    ! Indicates the orientation of an HRTF directivity object. This is a row-major 3x3 rotation matrix.

    FLAG ¶

    FLAG :: enum u32 {
    	DEBUG_ENGINE            = 0,  // Used in Create
    	VOICE_NOPITCH           = 1,  // Used in IXAudio2.CreateSourceVoice
    	VOICE_NOSRC             = 2,  // Used in IXAudio2.CreateSourceVoice
    	VOICE_USEFILTER         = 3,  // Used in IXAudio2.CreateSource/SubmixVoice
    	PLAY_TAILS              = 5,  // Used in IXAudio2SourceVoice.Stop
    	END_OF_STREAM           = 6,  // Used in BUFFER.Flags
    	SEND_USEFILTER          = 7,  // Used in SEND_DESCRIPTOR.Flags
    	VOICE_NOSAMPLESPLAYED   = 8,  // Used in IXAudio2SourceVoice.GetState
    	STOP_ENGINE_WHEN_IDLE   = 13, // Used in Create to force the engine to Stop when no source voices are Started, and Start when a voice is Started
    	QUANTUM_1024            = 15, // Used in Create to specify nondefault processing quantum of 21.33 ms (1024 samples at 48KHz)
    	NO_VIRTUAL_AUDIO_CLIENT = 16, // Used in CreateMasteringVoice to create a virtual audio client
    }

    FLAG ¶

    FLAG :: VOICE_STATE
     

    Returned by IXAudio2SourceVoice.GetState

    FLAGS ¶

    FLAGS :: distinct bit_set[FLAG; u32]
     

    Flags

    Related Procedures With Parameters

    FXECHO_INITDATA ¶

    FXECHO_INITDATA :: struct #packed {
    	MaxDelay: f32,
    }
     

    Echo initialization data, used with CreateFX: Use of this structure is optional, the default MaxDelay is FXECHO_DEFAULT_DELAY.

    FXECHO_PARAMETERS ¶

    FXECHO_PARAMETERS :: struct #packed {
    	WetDryMix: f32,
    	// ratio of wet (processed) signal to dry (original) signal
    	Feedback:  f32,
    	// amount of output fed back into input
    	Delay:     f32,
    }
     

    Echo parameters, used with IXAPOParameters.SetParameters: The echo supports only f32 audio formats.

    FXEQ_PARAMETERS ¶

    FXEQ_PARAMETERS :: struct #packed {
    	FrequencyCenter0: f32,
    	// center frequency in Hz, band 0
    	Gain0:            f32,
    	// boost/cut
    	Bandwidth0:       f32,
    	// bandwidth, region of EQ is center frequency +/- bandwidth/2
    	FrequencyCenter1: f32,
    	// band 1
    	Gain1:            f32,
    	Bandwidth1:       f32,
    	FrequencyCenter2: f32,
    	// band 2
    	Gain2:            f32,
    	Bandwidth2:       f32,
    	FrequencyCenter3: f32,
    	// band 3
    	Gain3:            f32,
    	Bandwidth3:       f32,
    }
     

    EQ parameters (4 bands), used with IXAPOParameters.SetParameters: The EQ supports only f32 audio foramts. The framerate must be within [22000, 48000] Hz.

    FXMASTERINGLIMITER_MAX_RELEASE ¶

    FXMASTERINGLIMITER_MAX_RELEASE :: IXAudio2Voice

    FXMASTERINGLIMITER_PARAMETERS ¶

    FXMASTERINGLIMITER_PARAMETERS :: struct #packed {
    	Release:  u32,
    	// release time (tuning factor with no specific units)
    	Loudness: u32,
    }
     

    Mastering limiter parameters, used with IXAPOParameters.SetParameters: The mastering limiter supports only f32 audio formats.

    FXREVERB_PARAMETERS ¶

    FXREVERB_PARAMETERS :: struct #packed {
    	Diffusion: f32,
    	// diffusion
    	RoomSize:  f32,
    }
     

    Reverb parameters, used with IXAPOParameters.SetParameters: The reverb supports only f32 audio formats with the following channel configurations: Input: Mono Output: Mono Input: Stereo Output: Stereo

    HANDLE ¶

    HANDLE :: distinct [20]u8
     

    instance handle of precalculated constants

    Related Procedures With Parameters

    HrtfApoInit ¶

    HrtfApoInit :: struct {
    	// ! The decay type. If you pass in nil, the default value will be used. The default is natural decay.
    	distanceDecay: ^HrtfDistanceDecay,
    	// ! The directivity type. If you pass in nil, the default value will be used. The default directivity is omni-directional.
    	directivity:   ^HrtfDirectivity,
    }
     

    ! Specifies parameters used to initialize HRTF. ! Instances of the XAPO interface are created by using the CreateHrtfApo() API: ! `CreateHrtfApo :: proc(pInit: HrtfApoInit, ppXapo: ^^IXAPO) -> HRESULT`

    Related Procedures With Parameters

    HrtfDirectivity ¶

    HrtfDirectivity :: struct {
    	// ! Indicates the type of directivity.
    	type:    HrtfDirectivityType,
    	// ! A normalized value between zero and one. Specifies the amount of linear interpolation between omnidirectional sound and the full directivity pattern, where 0 is fully omnidirectional and 1 is fully directional.
    	scaling: f32,
    }
     

    ! Base directivity pattern descriptor. Describes the type of directivity applied to a sound. ! The scaling parameter is used to interpolate between directivity behavior and omnidirectional, it determines how much attenuation is applied to the source outside of the directivity pattern and controls how directional the source is.

    HrtfDirectivityCardioid ¶

    HrtfDirectivityCardioid :: struct {
    	// ! Descriptor for the cardioid pattern. The type parameter must be set to HrtfDirectivityType.Cardioid.
    	directivity: HrtfDirectivity,
    	// ! Order controls the shape of the cardioid. The higher order the shape, the narrower it is. Must be greater than 0 and less than or equal to 32.
    	order:       f32,
    }
     

    ! Describes a cardioid directivity pattern.

    HrtfDirectivityCone ¶

    HrtfDirectivityCone :: struct {
    	// ! Descriptor for the cone pattern. The type parameter must be set to HrtfDirectivityType.Cone.
    	directivity: HrtfDirectivity,
    	// ! Angle, in radians, that defines the inner cone. Must be between 0 and TAU.
    	innerAngle:  f32,
    	// ! Angle, in radians, that defines the outer cone. Must be between 0 and TAU.
    	outerAngle:  f32,
    }
     

    ! Describes a cone directivity. ! Attenuation is 0 inside the inner cone. ! Attenuation is linearly interpolated between the inner cone, which is defined by innerAngle, and the outer cone, which is defined by outerAngle.

    HrtfDirectivityType ¶

    HrtfDirectivityType :: enum i32 {
    	// ! The sound emission is in all directions.
    	OmniDirectional = 0, 
    	// ! The sound emission is a cardiod shape.
    	Cardioid, 
    	// ! The sound emission is a cone.
    	Cone, 
    }
     

    ! Indicates one of several stock directivity patterns.

    HrtfDistanceDecay ¶

    HrtfDistanceDecay :: struct {
    	// ! The type of decay behavior, natural or custom.
    	type:              HrtfDistanceDecayType,
    	// ! The maximum gain limit applied at any distance. Applies to both natural and custom decay. This value is specified in dB, with a range from -96 to 12 inclusive. The default value is 12 dB.
    	maxGain:           f32,
    	// ! The minimum gain limit applied at any distance. Applies to both natural and custom decay. This value is specified in dB, with a range from -96 to 12 inclusive. The default value is -96 dB.
    	minGain:           f32,
    	// ! The distance at which the gain is 0dB. Applies to natural decay only. This value is specified in meters, with a range from 0.05 to infinity (max(f32)). The default value is 1 meter.
    	unityGainDistance: f32,
    	// ! The distance at which output is silent. Applies to natural decay only. This value is specified in meters, with a range from zero (non-inclusive) to infinity (max(f32)). The default value is infinity.
    	cutoffDistance:    f32,
    }
     

    ! Describes a distance-based decay behavior.

    HrtfDistanceDecayType ¶

    HrtfDistanceDecayType :: enum i32 {
    	// ! Simulates natural decay with distance, as constrained by minimum and maximum gain distance limits. Drops to silence at rolloff distance.
    	NaturalDecay = 0, 
    	// ! Used to set up a custom gain curve, within the maximum and minimum gain limit.
    	CustomDecay, 
    }
     

    ! Indicates a distance-based decay type applied to a sound.

    HrtfEnvironment ¶

    HrtfEnvironment :: enum i32 {
    	// ! A small room.
    	Small    = 0, 
    	// ! A medium-sized room.
    	Medium, 
    	// ! A large enclosed space.
    	Large, 
    	// ! An outdoor space.
    	Outdoors, 
    }
     

    ! Indicates one of several stock environment types.

    HrtfPosition ¶

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

    ! Represents a position in 3D space, using a right-handed coordinate system.

    IUnknown ¶

    IUnknown :: sys_windows.IUnknown

    IUnknown_VTable ¶

    IUnknown_VTable :: sys_windows.IUnknown_VTable

    IXAPO ¶

    IXAPO :: struct #raw_union {
    	iunknown:     sys_windows.IUnknown,
    	using ixapo_vtable: ^IXAPO_VTable,
    }

    IXAPOHrtfParameters ¶

    IXAPOHrtfParameters :: struct #raw_union {
    	iunknown:                   sys_windows.IUnknown,
    	using ixapohrtfparameters_vtable: ^IXAPOHrtfParameters_VTable,
    }

    IXAPOHrtfParameters ¶

    IXAPOHrtfParameters :: XAPO_FLAG

    IXAPOHrtfParameters_VTable ¶

    IXAPOHrtfParameters_VTable :: VOICE_SENDS
     

    Used in the voice creation functions and in IXAudio2Voice.SetOutputVoices

    IXAPOHrtfParameters_VTable ¶

    IXAPOHrtfParameters_VTable :: struct {
    	using iunknown_vtable: sys_windows.IUnknown_VTable,
    	// HRTF params
    	// ! The position of the sound relative to the listener.
    	SetSourcePosition:    proc "stdcall" (this: ^IXAPOHrtfParameters, position: ^HrtfPosition) -> sys_windows.HRESULT,
    	// ! The rotation matrix for the source orientation, with respect to the listener's frame of reference (the listener's coordinate system).
    	SetSourceOrientation: proc "stdcall" (this: ^IXAPOHrtfParameters, orientation: ^HrtfOrientation) -> sys_windows.HRESULT,
    	// ! The custom direct path gain value for the current source position. Valid only for sounds played with the HrtfDistanceDecayType. Custom decay type.
    	SetSourceGain:        proc "stdcall" (this: ^IXAPOHrtfParameters, gain: f32) -> sys_windows.HRESULT,
    	// Distance cue params
    	// ! Selects the acoustic environment to simulate.
    	SetEnvironment:       proc "stdcall" (this: ^IXAPOHrtfParameters, environment: HrtfEnvironment) -> sys_windows.HRESULT,
    }

    IXAPOParameters ¶

    IXAPOParameters :: struct #raw_union {
    	iunknown:               sys_windows.IUnknown,
    	using ixapoparameters_vtable: ^IXAPOParameters_VTable,
    }

    IXAPOParameters_VTable ¶

    IXAPOParameters_VTable :: struct {
    	using iunknown_vtable: sys_windows.IUnknown_VTable,
    	// DESCRIPTION:
    	//  Sets effect-specific parameters.
    	// REMARKS:
    	//  This method may only be called on the realtime thread; no synchronization between it and IXAPO.Process is necessary.
    	//  This method should not block as it is called from the realtime thread.
    	// PARAMETERS:
    	//  pParameters       - [in] effect-specific parameter block, must be != nil
    	//  ParameterByteSize - [in] size of pParameters in bytes, must be > 0
    	// RETURN VALUE:
    	//  void
    	SetParameters:   proc "stdcall" (this: ^IXAPOParameters, pParameters: rawptr, ParameterByteSize: u32),
    	// DESCRIPTION:
    	//  Gets effect-specific parameters.
    	// REMARKS:
    	//  Unlike SetParameters, XAudio2 does not call this method on the realtime thread.  Thus, the XAPO must protect variables shared with SetParameters/Process using appropriate synchronization.
    	// PARAMETERS:
    	//  pParameters       - [out] receives effect-specific parameter block, must be != nil
    	//  ParameterByteSize - [in]  size of pParameters in bytes, must be > 0
    	// RETURN VALUE:
    	//  void
    	GetParameters:   proc "stdcall" (this: ^IXAPOParameters, pParameters: rawptr, ParameterByteSize: u32),
    }

    IXAPO_VTable ¶

    IXAPO_VTable :: struct {
    	using iunknown_vtable:     sys_windows.IUnknown_VTable,
    	// DESCRIPTION:
    	//  Allocates a copy of the registration properties of the XAPO.
    	// PARAMETERS:
    	//  ppRegistrationProperties - [out] receives pointer to copy of registration properties, use XAPOFree to free structure, left untouched on failure
    	// RETURN VALUE:
    	//  COM error code
    	GetRegistrationProperties: proc "stdcall" (this: ^IXAPO, ppRegistrationProperties: ^^XAPO_REGISTRATION_PROPERTIES) -> sys_windows.HRESULT,
    	// DESCRIPTION:
    	//  Queries if an input/output configuration is supported.
    	// REMARKS:
    	//  This method allows XAPOs to express dependency of input format with respect to output format.
    	//  If the input/output format pair configuration is unsupported, this method also determines the nearest input format supported.
    	//  Nearest meaning closest bit depth, framerate, and channel count, in that order of importance.
    	//  The behaviour of this method should remain constant after the XAPO has been initialized.
    	// PARAMETERS:
    	//  pOutputFormat          - [in]  output format known to be supported
    	//  pRequestedInputFormat  - [in]  input format to examine
    	//  ppSupportedInputFormat - [out] receives pointer to nearest input format supported if not nil and input/output configuration unsupported, use XAPOFree to free structure, left untouched on any failure except FORMAT_UNSUPPORTED
    	// RETURN VALUE:
    	//  COM error code, including:
    	//    S_OK                      - input/output configuration supported, ppSupportedInputFormat left untouched
    	//    FORMAT_UNSUPPORTED        - input/output configuration unsupported, ppSupportedInputFormat receives pointer to nearest input format supported if not nil
    	//    E_INVALIDARG              - either audio format invalid, ppSupportedInputFormat left untouched
    	IsInputFormatSupported:    proc "stdcall" (this: ^IXAPO, pOutputFormat: ^sys_windows.WAVEFORMATEX, pRequestedInputFormat: ^sys_windows.WAVEFORMATEX, ppSupportedInputFormat: ^^sys_windows.WAVEFORMATEX) -> sys_windows.HRESULT,
    	// DESCRIPTION:
    	//  Queries if an input/output configuration is supported.
    	// REMARKS:
    	//  This method allows XAPOs to express dependency of output format with respect to input format.
    	//  If the input/output format pair configuration is unsupported, this method also determines the nearest output format supported.
    	//  Nearest meaning closest bit depth, framerate, and channel count, in that order of importance.
    	//  The behaviour of this method should remain constant after the XAPO has been initialized.
    	// PARAMETERS:
    	//  pInputFormat            - [in]  input format known to be supported
    	//  pRequestedOutputFormat  - [in]  output format to examine
    	//  ppSupportedOutputFormat - [out] receives pointer to nearest output format supported if not nil and input/output configuration unsupported, use XAPOFree to free structure, left untouched on any failure except FORMAT_UNSUPPORTED
    	// RETURN VALUE:
    	//  COM error code, including:
    	//    S_OK                      - input/output configuration supported, ppSupportedOutputFormat left untouched
    	//    FORMAT_UNSUPPORTED        - input/output configuration unsupported, ppSupportedOutputFormat receives pointer to nearest output format supported if not nil
    	//    E_INVALIDARG              - either audio format invalid, ppSupportedOutputFormat left untouched
    	IsOutputFormatSupported:   proc "stdcall" (this: ^IXAPO, pInputFormat: ^sys_windows.WAVEFORMATEX, pRequestedOutputFormat: ^sys_windows.WAVEFORMATEX, ppSupportedOutputFormat: ^^sys_windows.WAVEFORMATEX) -> sys_windows.HRESULT,
    	// DESCRIPTION:
    	//  Performs any effect-specific initialization if required.
    	// REMARKS:
    	//  The contents of pData are defined by the XAPO.
    	//  Immutable variables (constant during the lifespan of the XAPO) should be set once via this method.
    	//  Once initialized, an XAPO cannot be initialized again.
    	//  An XAPO should be initialized before passing it to XAudio2 as part of an effect chain. XAudio2 will not call this method; it exists for future content-driven initialization.
    	// PARAMETERS:
    	//  pData        - [in] effect-specific initialization parameters, may be nil if DataByteSize == 0
    	//  DataByteSize - [in] size of pData in bytes, may be 0 if pData is nil
    	// RETURN VALUE:
    	//  COM error code
    	Initialize:                proc "stdcall" (this: ^IXAPO, pData: rawptr, DataByteSize: u32) -> sys_windows.HRESULT,
    	// DESCRIPTION:
    	//  Resets variables dependent on frame history.
    	// REMARKS:
    	//  All other variables remain unchanged, including variables set by IXAPOParameters.SetParameters.
    	//  For example, an effect with delay should zero out its delay line during this method, but should not reallocate anything as the
    	//  XAPO remains locked with a constant input/output configuration. XAudio2 calls this method only if the XAPO is locked.
    	//  This method should not block as it is called from the realtime thread.
    	// PARAMETERS:
    	//  void
    	// RETURN VALUE:
    	//  void
    	Reset:                     proc "stdcall" (this: ^IXAPO),
    	// DESCRIPTION:
    	//  Locks the XAPO to a specific input/output configuration,
    	//  allowing it to do any final initialization before Process
    	//  is called on the realtime thread.
    	// REMARKS:
    	//  Once locked, the input/output configuration and any other locked variables remain constant until UnlockForProcess is called.
    	//  XAPOs should assert the input/output configuration is supported and that any required effect-specific initialization is complete.
    	//  IsInputFormatSupported, IsOutputFormatSupported, and Initialize should be called as necessary before this method is called.
    	//  All internal memory buffers required for Process should be allocated by the time this method returns successfully as Process is non-blocking and should not allocate memory.
    	//  Once locked, an XAPO cannot be locked again until UnLockForProcess is called.
    	// PARAMETERS:
    	//  InputLockedParameterCount  - [in] number of input buffers, must be within [XAPO_REGISTRATION_PROPERTIES.MinInputBufferCount, XAPO_REGISTRATION_PROPERTIES.MaxInputBufferCount]
    	//  pInputLockedParameters     - [in] array of input locked buffer parameter structures, may be nil if InputLockedParameterCount == 0, otherwise must have InputLockedParameterCount elements
    	//  OutputLockedParameterCount - [in] number of output buffers, must be within [XAPO_REGISTRATION_PROPERTIES.MinOutputBufferCount, XAPO_REGISTRATION_PROPERTIES.MaxOutputBufferCount], must match InputLockedParameterCount when XAPO_FLAG.BUFFERCOUNT_MUST_MATCH used
    	//  pOutputLockedParameters    - [in] array of output locked buffer parameter structures, may be nil if OutputLockedParameterCount == 0, otherwise must have OutputLockedParameterCount elements
    	// RETURN VALUE:
    	//  COM error code
    	LockForProcess:            proc "stdcall" (this: ^IXAPO, InputLockedParameterCount: u32, pInputLockedParameters: [^]XAPO_LOCKFORPROCESS_BUFFER_PARAMETERS, OutputLockedParameterCount: u32, pOutputLockedParameters: [^]XAPO_LOCKFORPROCESS_BUFFER_PARAMETERS) -> sys_windows.HRESULT,
    	// DESCRIPTION:
    	//  Opposite of LockForProcess.  Variables allocated during LockForProcess should be deallocated by this method.
    	// REMARKS:
    	//  Unlocking an XAPO allows an XAPO instance to be reused with different input/output configurations.
    	// PARAMETERS:
    	//  void
    	// RETURN VALUE:
    	//  void
    	UnlockForProcess:          proc "stdcall" (this: ^IXAPO),
    	// DESCRIPTION:
    	//  Runs the XAPO's DSP code on the given input/output buffers.
    	// REMARKS:
    	//  In addition to writing to the output buffers as appropriate, an XAPO must set the BufferFlags and ValidFrameCount members of all elements in pOutputProcessParameters accordingly.
    	//  ppInputProcessParameters will not necessarily be the same as ppOutputProcessParameters for in-place processing, rather the pBuffer members of each will point to the same memory.
    	//  Multiple input/output buffers may be used with in-place XAPOs, though the input buffer count must equal the output buffer count.
    	//  When multiple input/output buffers are used with in-place XAPOs, the XAPO may assume input buffer [N] equals output buffer [N].
    	//  When IsEnabled is false, the XAPO should process thru. Thru processing means an XAPO should not apply its normal processing to the given input/output buffers during Process.
    	//  It should instead pass data from input to output with as little modification possible. Effects that perform format conversion should continue to do so.
    	//  The effect must ensure transitions between normal and thru processing do not introduce discontinuities into the signal.
    	//  XAudio2 calls this method only if the XAPO is locked. This method should not block as it is called from the realtime thread.
    	// PARAMETERS:
    	//  InputProcessParameterCount  - [in]     number of input buffers, matches respective InputLockedParameterCount parameter given to LockForProcess
    	//  pInputProcessParameters     - [in]     array of input process buffer parameter structures, may be nil if InputProcessParameterCount == 0, otherwise must have InputProcessParameterCount elements
    	//  OutputProcessParameterCount - [in]     number of output buffers, matches respective OutputLockedParameterCount parameter given to LockForProcess
    	//  pOutputProcessParameters    - [in/out] array of output process buffer parameter structures, may be nil if OutputProcessParameterCount == 0, otherwise must have OutputProcessParameterCount elements
    	//  IsEnabled                   - [in]     true to process normally, false to process thru
    	// RETURN VALUE:
    	//  void
    	Process:                   proc "stdcall" (this: ^IXAPO, InputProcessParameterCount: u32, pInputProcessParameters: [^]XAPO_PROCESS_BUFFER_PARAMETERS, OutputProcessParameterCount: u32, pOutputProcessParameters: [^]XAPO_PROCESS_BUFFER_PARAMETERS, IsEnabled: b32),
    	// DESCRIPTION:
    	//  Returns the number of input frames required to generate the requested number of output frames.
    	// REMARKS:
    	//  XAudio2 may call this method to determine how many input frames an XAPO requires.
    	//  This is constant for locked CBR XAPOs; this method need only be called once while an XAPO is locked.
    	//  XAudio2 calls this method only if the XAPO is locked. This method should not block as it is called from the realtime thread.
    	// PARAMETERS:
    	//  OutputFrameCount - [in] requested number of output frames, must be within respective [0, XAPO_LOCKFORPROCESS_BUFFER_PARAMETERS.MaxFrameCount], always XAPO_LOCKFORPROCESS_BUFFER_PARAMETERS.MaxFrameCount for CBR/user-defined XAPOs
    	// RETURN VALUE:
    	//  number of input frames required
    	CalcInputFrames:           proc "stdcall" (this: ^IXAPO, OutputFrameCount: u32) -> u32,
    	// DESCRIPTION:
    	//  Returns the number of output frames generated for the requested number of input frames.
    	// REMARKS:
    	//  XAudio2 may call this method to determine how many output frames an XAPO will generate.  This is constant for locked CBR XAPOs; this method need only be called once while an XAPO is locked.
    	//  XAudio2 calls this method only if the XAPO is locked. This method should not block as it is called from the realtime thread.
    	// PARAMETERS:
    	//  InputFrameCount - [in] requested number of input frames, must be within respective [0, XAPO_LOCKFORPROCESS_BUFFER_PARAMETERS.MaxFrameCount], always XAPO_LOCKFORPROCESS_BUFFER_PARAMETERS.MaxFrameCount for CBR/user-defined XAPOs
    	// RETURN VALUE:
    	//  number of output frames generated
    	CalcOutputFrames:          proc "stdcall" (this: ^IXAPO, InputFrameCount: u32) -> u32,
    }

    IXAudio2 ¶

    IXAudio2 :: struct #raw_union {
    	iunknown:        sys_windows.IUnknown,
    	using ixaudio2_vtable: ^IXAudio2_VTable,
    }

    IXAudio2EngineCallback ¶

    IXAudio2EngineCallback :: struct {
    	using ixaudio2enginecallback_vtable: ^IXAudio2EngineCallback_VTable,
    }

    IXAudio2EngineCallback_VTable ¶

    IXAudio2EngineCallback_VTable :: struct {
    	// Called by XAudio2 just before an audio processing pass begins.
    	OnProcessingPassStart: proc "stdcall" (this: ^IXAudio2EngineCallback),
    	// Called just after an audio processing pass ends.
    	OnProcessingPassEnd:   proc "stdcall" (this: ^IXAudio2EngineCallback),
    	// Called in the event of a critical system error which requires XAudio2 to be closed down and restarted. The error code is given in Error.
    	OnCriticalError:       proc "stdcall" (this: ^IXAudio2EngineCallback, Error: sys_windows.HRESULT),
    }

    IXAudio2Extension ¶

    IXAudio2Extension :: struct #raw_union {
    	iunknown:                 sys_windows.IUnknown,
    	using ixaudio2extension_vtable: ^IXAudio2Extension_VTable,
    }

    IXAudio2Extension_VTable ¶

    IXAudio2Extension_VTable :: struct {
    	using iunknown_vtable: sys_windows.IUnknown_VTable,
    	// NAME: IXAudio2Extension.GetProcessingQuantum
    	// DESCRIPTION: Returns the processing quantum
    	//              quantumMilliseconds = (1000.0f * quantumNumerator / quantumDenominator)
    	// ARGUMENTS:
    	//  quantumNumerator - Quantum numerator
    	//  quantumDenominator - Quantum denominator
    	GetProcessingQuantum: proc "stdcall" (this: ^IXAudio2Extension, quantumNumerator: ^u32, quantumDenominator: ^u32),
    	// NAME: IXAudio2Extension.GetProcessor
    	// DESCRIPTION: Returns the number of the processor used by XAudio2
    	// ARGUMENTS:
    	//  processor - Non-zero Processor number
    	GetProcessor:         proc "stdcall" (this: ^IXAudio2Extension, processor: ^PROCESSOR_FLAGS),
    }

    IXAudio2MasteringVoice ¶

    IXAudio2MasteringVoice :: struct #raw_union {
    	ixaudio2voice:                 IXAudio2Voice,
    	using ixaudio2masteringvoice_vtable: ^IXAudio2MasteringVoice_VTable,
    }

    IXAudio2MasteringVoice_VTable ¶

    IXAudio2MasteringVoice_VTable :: struct {
    	using ixaudio2voice_vtable: IXAudio2Voice_VTable,
    	// NAME: IXAudio2MasteringVoice.GetChannelMask
    	// DESCRIPTION: Returns the channel mask for this voice
    	// ARGUMENTS:
    	//  pChannelMask - returns the channel mask for this voice.  This corresponds to the dwChannelMask member of WAVEFORMATEXTENSIBLE.
    	GetChannelMask:       proc "stdcall" (this: ^IXAudio2MasteringVoice, pChannelmask: ^u32) -> sys_windows.HRESULT,
    }

    IXAudio2SourceVoice ¶

    IXAudio2SourceVoice :: struct #raw_union {
    	ixaudio2voice:              IXAudio2Voice,
    	using ixaudio2sourcevoice_vtable: ^IXAudio2SourceVoice_VTable,
    }

    IXAudio2SourceVoice_VTable ¶

    IXAudio2SourceVoice_VTable :: struct {
    	using ixaudio2voice_vtable: IXAudio2Voice_VTable,
    	// NAME: IXAudio2SourceVoice.Start
    	// DESCRIPTION: Makes this voice start consuming and processing audio.
    	// ARGUMENTS:
    	//  Flags - Flags controlling how the voice should be started.
    	//  OperationSet - Used to identify this call as part of a deferred batch.
    	Start:                proc "stdcall" (this: ^IXAudio2SourceVoice, Flags: FLAGS = {}, OperationSet: u32 = COMMIT_NOW) -> sys_windows.HRESULT,
    	// NAME: IXAudio2SourceVoice.Stop
    	// DESCRIPTION: Makes this voice stop consuming audio.
    	// ARGUMENTS:
    	//  Flags - Flags controlling how the voice should be stopped.
    	//  OperationSet - Used to identify this call as part of a deferred batch.
    	Stop:                 proc "stdcall" (this: ^IXAudio2SourceVoice, Flags: FLAGS = {}, OperationSet: u32 = COMMIT_NOW) -> sys_windows.HRESULT,
    	// NAME: IXAudio2SourceVoice.SubmitSourceBuffer
    	// DESCRIPTION: Adds a new audio buffer to this voice's input queue.
    	// ARGUMENTS:
    	//  pBuffer - Pointer to the buffer structure to be queued.
    	//  pBufferWMA - Additional structure used only when submitting XWMA data.
    	SubmitSourceBuffer:   proc "stdcall" (this: ^IXAudio2SourceVoice, pBuffer: ^BUFFER, pBufferWMA: ^BUFFER_WMA = nil) -> sys_windows.HRESULT,
    	// NAME: IXAudio2SourceVoice.FlushSourceBuffers
    	// DESCRIPTION: Removes all pending audio buffers from this voice's queue.
    	FlushSourceBuffers:   proc "stdcall" (this: ^IXAudio2SourceVoice) -> sys_windows.HRESULT,
    	// NAME: IXAudio2SourceVoice.Discontinuity
    	// DESCRIPTION: Notifies the voice of an intentional break in the stream of audio buffers (e.g. the end of a sound), to prevent XAudio2 from interpreting an empty buffer queue as a glitch.
    	Discontinuity:        proc "stdcall" (this: ^IXAudio2SourceVoice) -> sys_windows.HRESULT,
    	// NAME: IXAudio2SourceVoice.ExitLoop
    	// DESCRIPTION: Breaks out of the current loop when its end is reached.
    	// ARGUMENTS:
    	//  OperationSet - Used to identify this call as part of a deferred batch.
    	ExitLoop:             proc "stdcall" (this: ^IXAudio2SourceVoice, OperationSet: u32 = COMMIT_NOW) -> sys_windows.HRESULT,
    	// NAME: IXAudio2SourceVoice.GetState
    	// DESCRIPTION: Returns the number of buffers currently queued on this voice, the pContext value associated with the currently processing buffer (if any), and other voice state information.
    	// ARGUMENTS:
    	//  pVoiceState - Returns the state information.
    	//  Flags - Flags controlling what voice state is returned.
    	GetState:             proc "stdcall" (this: ^IXAudio2SourceVoice, pVoiceState: ^VOICE_STATE, Flags: FLAGS = {}),
    	// NAME: IXAudio2SourceVoice.SetFrequencyRatio
    	// DESCRIPTION: Sets this voice's frequency adjustment, i.e. its pitch.
    	// ARGUMENTS:
    	//  Ratio - Frequency change, expressed as source frequency / target frequency.
    	//  OperationSet - Used to identify this call as part of a deferred batch.
    	SetFrequencyRatio:    proc "stdcall" (this: ^IXAudio2SourceVoice, Ratio: f32, OperationSet: u32 = COMMIT_NOW) -> sys_windows.HRESULT,
    	// NAME: IXAudio2SourceVoice.GetFrequencyRatio
    	// DESCRIPTION: Returns this voice's current frequency adjustment ratio.
    	// ARGUMENTS:
    	//  pRatio - Returns the frequency adjustment.
    	GetFrequencyRatio:    proc "stdcall" (this: ^IXAudio2SourceVoice, pRatio: ^f32),
    	// NAME: IXAudio2SourceVoice.SetSourceSampleRate
    	// DESCRIPTION: Reconfigures this voice to treat its source data as being at a different sample rate than the original one specified in CreateSourceVoice's pSourceFormat argument.
    	// ARGUMENTS:
    	//  UINT32 - The intended sample rate of further submitted source data.
    	SetSourceSampleRate:  proc "stdcall" (this: ^IXAudio2SourceVoice, NewSourceSampleRate: u32) -> sys_windows.HRESULT,
    }

    IXAudio2SubmixVoice ¶

    IXAudio2SubmixVoice :: struct #raw_union {
    	ixaudio2voice:              IXAudio2Voice,
    	using ixaudio2submixvoice_vtable: ^IXAudio2SubmixVoice_VTable,
    }

    IXAudio2SubmixVoice_VTable ¶

    IXAudio2SubmixVoice_VTable :: struct {
    	using ixaudio2voice_vtable: IXAudio2Voice_VTable,
    }

    IXAudio2VoiceCallback ¶

    IXAudio2VoiceCallback :: struct {
    	using ixaudio2voicecallback_vtable: ^IXAudio2VoiceCallback_VTable,
    }

    IXAudio2_VTable ¶

    IXAudio2_VTable :: struct {
    	using iunknown_vtable:  sys_windows.IUnknown_VTable,
    	// NAME: IXAudio2.RegisterForCallbacks
    	// DESCRIPTION: Adds a new client to receive XAudio2's engine callbacks.
    	// ARGUMENTS:
    	//  pCallback - Callback interface to be called during each processing pass.
    	RegisterForCallbacks:   proc "stdcall" (this: ^IXAudio2, pCallback: ^IXAudio2EngineCallback) -> sys_windows.HRESULT,
    	// NAME: IXAudio2.UnregisterForCallbacks
    	// DESCRIPTION: Removes an existing receiver of XAudio2 engine callbacks.
    	// ARGUMENTS:
    	//  pCallback - Previously registered callback interface to be removed.
    	UnregisterForCallbacks: proc "stdcall" (this: ^IXAudio2, pCallback: ^IXAudio2EngineCallback),
    	// NAME: IXAudio2.CreateSourceVoice
    	// DESCRIPTION: Creates and configures a source voice.
    	// ARGUMENTS:
    	//  ppSourceVoice - Returns the new object's IXAudio2SourceVoice interface.
    	//  pSourceFormat - Format of the audio that will be fed to the voice.
    	//  Flags - VOICE flags specifying the source voice's behavior.
    	//  MaxFrequencyRatio - Maximum SetFrequencyRatio argument to be allowed.
    	//  pCallback - Optional pointer to a client-provided callback interface.
    	//  pSendList - Optional list of voices this voice should send audio to.
    	//  pEffectChain - Optional list of effects to apply to the audio data.
    	CreateSourceVoice:      proc "stdcall" (this: ^IXAudio2, ppSourceVoice: ^^IXAudio2SourceVoice, pSourceFormat: ^sys_windows.WAVEFORMATEX, Flags: FLAGS = {}, MaxFrequencyRatio: f32 = DEFAULT_FREQ_RATIO, pCallback: ^IXAudio2VoiceCallback = nil, pSendList: [^]VOICE_SENDS = nil, pEffectChain: [^]EFFECT_CHAIN = nil) -> sys_windows.HRESULT,
    	// NAME: IXAudio2.CreateSubmixVoice
    	// DESCRIPTION: Creates and configures a submix voice.
    	// ARGUMENTS:
    	//  ppSubmixVoice - Returns the new object's IXAudio2SubmixVoice interface.
    	//  InputChannels - Number of channels in this voice's input audio data.
    	//  InputSampleRate - Sample rate of this voice's input audio data.
    	//  Flags - VOICE flags specifying the submix voice's behavior.
    	//  ProcessingStage - Arbitrary number that determines the processing order.
    	//  pSendList - Optional list of voices this voice should send audio to.
    	//  pEffectChain - Optional list of effects to apply to the audio data.
    	CreateSubmixVoice:      proc "stdcall" (this: ^IXAudio2, ppSubmixVoice: ^^IXAudio2SubmixVoice, InputChannels: u32, InputSampleRate: u32, Flags: FLAGS = {}, ProcessingStage: u32 = 0, pSendList: [^]VOICE_SENDS = nil, pEffectChain: [^]EFFECT_CHAIN = nil) -> sys_windows.HRESULT,
    	// NAME: IXAudio2.CreateMasteringVoice
    	// DESCRIPTION: Creates and configures a mastering voice.
    	// ARGUMENTS:
    	//  ppMasteringVoice - Returns the new object's IXAudio2MasteringVoice interface.
    	//  InputChannels - Number of channels in this voice's input audio data.
    	//  InputSampleRate - Sample rate of this voice's input audio data.
    	//  Flags - VOICE flags specifying the mastering voice's behavior.
    	//  szDeviceId - Identifier of the device to receive the output audio.
    	//  pEffectChain - Optional list of effects to apply to the audio data.
    	//  StreamCategory - The audio stream category to use for this mastering voice
    	CreateMasteringVoice:   proc "stdcall" (this: ^IXAudio2, ppMasteringVoice: ^^IXAudio2MasteringVoice, InputChannels: u32 = DEFAULT_CHANNELS, InputSampleRate: u32 = DEFAULT_SAMPLERATE, Flags: FLAGS = {}, szDeviceId: cstring16 = nil, pEffectChain: [^]EFFECT_CHAIN = nil, StreamCategory: AUDIO_STREAM_CATEGORY = .GameEffects) -> sys_windows.HRESULT,
    	// NAME: IXAudio2.:StartEngine
    	// DESCRIPTION: Creates and starts the audio processing thread.
    	StartEngine:            proc "stdcall" (this: ^IXAudio2) -> sys_windows.HRESULT,
    	// NAME: IXAudio2.StopEngine
    	// DESCRIPTION: Stops and destroys the audio processing thread.
    	StopEngine:             proc "stdcall" (this: ^IXAudio2),
    	// NAME: IXAudio2.CommitChanges
    	// DESCRIPTION: Atomically applies a set of operations previously tagged with a given identifier.
    	// ARGUMENTS:
    	//  OperationSet - Identifier of the set of operations to be applied.
    	CommitChanges:          proc "stdcall" (this: ^IXAudio2, OperationSet: u32) -> sys_windows.HRESULT,
    	// NAME: IXAudio2.GetPerformanceData
    	// DESCRIPTION: Returns current resource usage details: memory, CPU, etc.
    	// ARGUMENTS:
    	//  pPerfData - Returns the performance data structure.
    	GetPerformanceData:     proc "stdcall" (this: ^IXAudio2, pPerfData: ^PERFORMANCE_DATA),
    	// NAME: IXAudio2.SetDebugConfiguration
    	// DESCRIPTION: Configures XAudio2's debug output (in debug builds only).
    	// ARGUMENTS:
    	//  pDebugConfiguration - Structure describing the debug output behavior.
    	//  pReserved - Optional parameter; must be nil.
    	SetDebugConfiguration:  proc "stdcall" (this: ^IXAudio2, pDebugConfiguration: ^DEBUG_CONFIGURATION, pReserved: rawptr = nil),
    }

    LISTENER ¶

    LISTENER :: struct #packed {
    	OrientFront: VECTOR,
    	// orientation of front direction, used only for matrix and delay calculations or listeners with cones for matrix, LPF (both direct and reverb paths), and reverb calculations, must be normalized when used
    	OrientTop:   VECTOR,
    	// orientation of top direction, used only for matrix and delay calculations, must be orthonormal with OrientFront when used
    	Position:    VECTOR,
    	// position in user-defined world units, does not affect Velocity
    	Velocity:    VECTOR,
    	// velocity vector in user-defined world units/second, used only for doppler calculations, does not affect Position
    	pCone:       ^CONE,
    }
     

    Listener: Defines a point of 3D audio reception. The cone is directed by the listener's front orientation.

    Related Procedures With Parameters

    LISTENER ¶

    LISTENER :: SEND_DESCRIPTOR
     

    Used in VOICE_SENDS below

    PERFORMANCE_DATA ¶

    PERFORMANCE_DATA :: struct #packed {
    	// CPU usage information
    	AudioCyclesSinceLastQuery:  u64,
    	// CPU cycles spent on audio processing since the last call to StartEngine or GetPerformanceData.
    	TotalCyclesSinceLastQuery:  u64,
    	// Total CPU cycles elapsed since the last call (only counts the CPU XAudio2 is running on).
    	MinimumCyclesPerQuantum:    u32,
    	// Fewest CPU cycles spent processing any one audio quantum since the last call.
    	MaximumCyclesPerQuantum:    u32,
    	// Memory usage information
    	MemoryUsageInBytes:         u32,
    	// Audio latency and glitching information
    	CurrentLatencyInSamples:    u32,
    	// Minimum delay from when a sample is read from a source buffer to when it reaches the speakers.
    	GlitchesSinceEngineStarted: u32,
    	// Data about XAudio2's current workload
    	ActiveSourceVoiceCount:     u32,
    	// Source voices currently playing.
    	TotalSourceVoiceCount:      u32,
    	// Source voices currently existing.
    	ActiveSubmixVoiceCount:     u32,
    	// Submix voices currently playing/existing.
    	ActiveResamplerCount:       u32,
    	// Resample xAPOs currently active.
    	ActiveMatrixMixCount:       u32,
    	// Usage of the hardware XMA decoder (Xbox 360 only)
    	ActiveXmaSourceVoices:      u32,
    	// Number of source voices decoding XMA data.
    	ActiveXmaStreams:           u32,
    }
     

    Returned by IXAudio2.GetPerformanceData

    PROCESSOR_FLAG ¶

    PROCESSOR_FLAG :: enum u32 {
    	Processor1  = 0, 
    	Processor2  = 1, 
    	Processor3  = 2, 
    	Processor4  = 3, 
    	Processor5  = 4, 
    	Processor6  = 5, 
    	Processor7  = 6, 
    	Processor8  = 7, 
    	Processor9  = 8, 
    	Processor10 = 9, 
    	Processor11 = 10, 
    	Processor12 = 11, 
    	Processor13 = 12, 
    	Processor14 = 13, 
    	Processor15 = 14, 
    	Processor16 = 15, 
    	Processor17 = 16, 
    	Processor18 = 17, 
    	Processor19 = 18, 
    	Processor20 = 19, 
    	Processor21 = 20, 
    	Processor22 = 21, 
    	Processor23 = 22, 
    	Processor24 = 23, 
    	Processor25 = 24, 
    	Processor26 = 25, 
    	Processor27 = 26, 
    	Processor28 = 27, 
    	Processor29 = 28, 
    	Processor30 = 29, 
    	Processor31 = 30, 
    	Processor32 = 31, 
    }

    PROCESSOR_FLAGS ¶

    PROCESSOR_FLAGS :: distinct bit_set[PROCESSOR_FLAG; u32]
     

    Used in Create, specifies which CPU(s) to use.

    Related Procedures With Parameters
    Related Constants

    REVERB_DEFAULT_DENSITY ¶

    REVERB_DEFAULT_DENSITY :: REVERB_PARAMETERS
    Related Procedures With Parameters

    REVERB_I3DL2_PARAMETERS ¶

    REVERB_I3DL2_PARAMETERS :: struct #packed {
    	// ratio of wet (processed) signal to dry (original) signal
    	WetDryMix:         f32,
    	// Standard I3DL2 parameters
    	Room:              i32,
    	// [-10000, 0] in mB (hundredths of decibels)
    	RoomHF:            i32,
    	// [-10000, 0] in mB (hundredths of decibels)
    	RoomRolloffFactor: f32,
    	// [0.0, 10.0]
    	DecayTime:         f32,
    	// [0.1, 20.0] in seconds
    	DecayHFRatio:      f32,
    	// [0.1, 2.0]
    	Reflections:       i32,
    	// [-10000, 1000] in mB (hundredths of decibels)
    	ReflectionsDelay:  f32,
    	// [0.0, 0.3] in seconds
    	Reverb:            i32,
    	// [-10000, 2000] in mB (hundredths of decibels)
    	ReverbDelay:       f32,
    	// [0.0, 0.1] in seconds
    	Diffusion:         f32,
    	// [0.0, 100.0] (percentage)
    	Density:           f32,
    	// [0.0, 100.0] (percentage)
    	HFReference:       f32,
    }
    Related Procedures With Parameters

    SPEAKER_7POINT1 ¶

    SPEAKER_7POINT1 :: VOLUMEMETER_LEVELS
     

    VOLUMEMETER_LEVELS: Receives results from GetEffectParameters(). The user is responsible for allocating pPeakLevels, pRMSLevels, and initializing ChannelCount accordingly. The volume meter does not support SetEffectParameters().

    VECTOR ¶

    VECTOR :: distinct [3]f32
     

    --------------<D-A-T-A---T-Y-P-E-S>---------------------------------------//

    VOICE_DETAILS ¶

    VOICE_DETAILS :: struct #packed {
    	CreatingFlags:   FLAGS,
    	ActiveFlags:     FLAGS,
    	InputChannels:   u32,
    	InputSampleRate: u32,
    }
     

    Returned by IXAudio2Voice.GetVoiceDetails

    WAVEFORMATEX ¶

    WAVEFORMATEX :: sys_windows.WAVEFORMATEX

    XAPOAlloc ¶

    XAPOAlloc :: FILTER_TYPE
     

    Used in FILTER_PARAMETERS below

    Related Constants

    XAPO_BUFFER_FLAGS ¶

    XAPO_BUFFER_FLAGS :: enum i32 {
    	SILENT, // silent data should be assumed, respective memory may be uninitialized
    	VALID,  // arbitrary data should be assumed (may or may not be silent frames), respective memory initialized
    }
     

    Buffer flags: Describes assumed content of the respective buffer. Used with XAPO_PROCESS_BUFFER_PARAMETERS.BufferFlags. This meta-data can be used by an XAPO to implement optimizations that require knowledge of a buffer's content. For example, XAPOs that always produce silent output from silent input can check the flag on the input buffer to determine if any signal processing is necessary. If silent, the XAPO may simply set the flag on the output buffer to silent and return, optimizing out the work of processing silent data: XAPOs that generate silence for any reason may set the buffer's flag accordingly rather than writing out silent frames to the buffer itself. The flags represent what should be assumed is in the respective buffer. The flags may not reflect what is actually stored in memory.

    XAPO_FLAGS ¶

    XAPO_FLAGS :: distinct bit_set[XAPO_FLAG; u32]
     

    XAPO property flags, used with XAPO_REGISTRATION_PROPERTIES.Flags:

    XAPO_LOCKFORPROCESS_BUFFER_PARAMETERS ¶

    XAPO_LOCKFORPROCESS_BUFFER_PARAMETERS :: struct #packed {
    	pFormat:       ^sys_windows.WAVEFORMATEX,
    	// buffer audio format
    	MaxFrameCount: u32,
    }
     

    LockForProcess buffer parameters: Defines buffer parameters that remain constant while an XAPO is locked. Used with IXAPO.LockForProcess. For CBR XAPOs, MaxFrameCount is the only number of frames IXAPO.Process would have to handle for the respective buffer.

    XAPO_PROCESS_BUFFER_PARAMETERS ¶

    XAPO_PROCESS_BUFFER_PARAMETERS :: struct #packed {
    	pBuffer:         rawptr,
    	// audio data buffer, must be non-nil
    	BufferFlags:     XAPO_BUFFER_FLAGS,
    	// describes assumed content of pBuffer, does not affect ValidFrameCount
    	ValidFrameCount: u32,
    }
     

    Process buffer parameters: Defines buffer parameters that may change from one processing pass to the next. Used with IXAPO.Process. Note the byte size of the respective buffer must be at least: XAPO_LOCKFORPROCESS_BUFFER_PARAMETERS.MaxFrameCount * XAPO_LOCKFORPROCESS_BUFFER_PARAMETERS.pFormat.nBlockAlign Although the audio format and maximum size of the respective buffer is locked (defined by XAPO_LOCKFORPROCESS_BUFFER_PARAMETERS), the actual memory address of the buffer given is permitted to change from one processing pass to the next. For CBR XAPOs, ValidFrameCount is constant while locked and equals the respective XAPO_LOCKFORPROCESS_BUFFER_PARAMETERS.MaxFrameCount.

    XAPO_REGISTRATION_PROPERTIES ¶

    XAPO_REGISTRATION_PROPERTIES :: struct #packed {
    	clsid:                sys_windows.GUID,
    	// COM class ID, used with CoCreate
    	FriendlyName:         [256]u16,
    	// friendly name unicode string
    	CopyrightInfo:        [256]u16,
    	// copyright information unicode string
    	MajorVersion:         u32,
    	// major version
    	MinorVersion:         u32,
    	// minor version
    	Flags:                XAPO_FLAGS,
    	// XAPO property flags, describes supported input/output configuration
    	MinInputBufferCount:  u32,
    	// minimum number of input buffers required for processing, can be 0
    	MaxInputBufferCount:  u32,
    	// maximum number of input buffers supported for processing, must be >= MinInputBufferCount
    	MinOutputBufferCount: u32,
    	// minimum number of output buffers required for processing, can be 0, must match MinInputBufferCount when XAPO_FLAG.BUFFERCOUNT_MUST_MATCH used
    	MaxOutputBufferCount: u32,
    }
     

    XAPO registration properties, describes general XAPO characteristics, used with IXAPO.GetRegistrationProperties

    Constants

    COMMIT_ALL ¶

    COMMIT_ALL :: 0
     

    Used in IXAudio2.CommitChanges

    COMMIT_NOW ¶

    COMMIT_NOW :: 0
     

    Numeric values with special meanings

    DEFAULT_CHANNELS ¶

    DEFAULT_CHANNELS :: 0
     

    Used in CreateMasteringVoice

    DEFAULT_FILTER_FREQUENCY ¶

    DEFAULT_FILTER_FREQUENCY :: MAX_FILTER_FREQUENCY

    DEFAULT_FILTER_ONEOVERQ ¶

    DEFAULT_FILTER_ONEOVERQ :: 1.0

    DEFAULT_FILTER_TYPE ¶

    DEFAULT_FILTER_TYPE :: FILTER_TYPE.LowPassFilter
     

    Default parameters for the built-in filter

    DEFAULT_FREQ_RATIO ¶

    DEFAULT_FREQ_RATIO :: 2.0
     

    Default MaxFrequencyRatio argument

    DEFAULT_SAMPLERATE ¶

    DEFAULT_SAMPLERATE :: 0
     

    Used in CreateMasteringVoice

    EFFECT_CHAIN ¶

    EFFECT_CHAIN :: REVERB_MIN_WET_DRY_MIX
     

    Maximum, minimum and default values for the parameters above

    FXECHO_DEFAULT_DELAY ¶

    FXECHO_DEFAULT_DELAY :: 500.0

    FXECHO_DEFAULT_FEEDBACK ¶

    FXECHO_DEFAULT_FEEDBACK :: 0.5

    FXECHO_DEFAULT_WETDRYMIX ¶

    FXECHO_DEFAULT_WETDRYMIX :: 0.5

    FXECHO_MAX_DELAY ¶

    FXECHO_MAX_DELAY :: 2000.0

    FXECHO_MAX_FEEDBACK ¶

    FXECHO_MAX_FEEDBACK :: 1.0

    FXECHO_MAX_WETDRYMIX ¶

    FXECHO_MAX_WETDRYMIX :: 1.0

    FXECHO_MIN_DELAY ¶

    FXECHO_MIN_DELAY :: 1.0

    FXEQ_DEFAULT_BANDWIDTH ¶

    FXEQ_DEFAULT_BANDWIDTH :: 1.0
     

    all bands

    FXEQ_DEFAULT_FREQUENCY_CENTER_0 ¶

    FXEQ_DEFAULT_FREQUENCY_CENTER_0 :: 100.0
     

    band 0

    FXEQ_DEFAULT_FREQUENCY_CENTER_1 ¶

    FXEQ_DEFAULT_FREQUENCY_CENTER_1 :: 800.0
     

    band 1

    FXEQ_DEFAULT_FREQUENCY_CENTER_2 ¶

    FXEQ_DEFAULT_FREQUENCY_CENTER_2 :: 2000.0
     

    band 2

    FXEQ_DEFAULT_FREQUENCY_CENTER_3 ¶

    FXEQ_DEFAULT_FREQUENCY_CENTER_3 :: 10000.0
     

    band 3

    FXEQ_DEFAULT_GAIN ¶

    FXEQ_DEFAULT_GAIN :: 1.0
     

    0dB change, all bands

    FXEQ_MAX_BANDWIDTH ¶

    FXEQ_MAX_BANDWIDTH :: 2.0

    FXEQ_MAX_FRAMERATE ¶

    FXEQ_MAX_FRAMERATE :: 48000

    FXEQ_MAX_FREQUENCY_CENTER ¶

    FXEQ_MAX_FREQUENCY_CENTER :: 20000.0

    FXEQ_MAX_GAIN ¶

    FXEQ_MAX_GAIN :: 7.94

    FXEQ_MIN_BANDWIDTH ¶

    FXEQ_MIN_BANDWIDTH :: 0.1

    FXEQ_MIN_FRAMERATE ¶

    FXEQ_MIN_FRAMERATE :: 22000
     

    EQ parameter bounds (inclusive), used with FXEQ:

    FXEQ_MIN_FREQUENCY_CENTER ¶

    FXEQ_MIN_FREQUENCY_CENTER :: 20.0

    FXEQ_MIN_GAIN ¶

    FXEQ_MIN_GAIN :: 0.126
     

    -18dB

    FXEQ_UUID_STRING ¶

    FXEQ_UUID_STRING :: "F5E01117-D6C4-485A-A3F5-695196F3DBFA"

    FXEcho_UUID_STRING ¶

    FXEcho_UUID_STRING :: "5039D740-F736-449A-84D3-A56202557B87"

    FXLOUDNESS_DEFAULT_SHORTTERM_MS ¶

    FXLOUDNESS_DEFAULT_SHORTTERM_MS :: 3000

    FXMASTERINGLIMITER_DEFAULT_LOUDNESS ¶

    FXMASTERINGLIMITER_DEFAULT_LOUDNESS :: 1000

    FXMASTERINGLIMITER_DEFAULT_RELEASE ¶

    FXMASTERINGLIMITER_DEFAULT_RELEASE :: 6

    FXMASTERINGLIMITER_MAX_LOUDNESS ¶

    FXMASTERINGLIMITER_MAX_LOUDNESS :: 1800

    FXMASTERINGLIMITER_MAX_RELEASE ¶

    FXMASTERINGLIMITER_MAX_RELEASE :: 20

    FXMASTERINGLIMITER_MIN_LOUDNESS ¶

    FXMASTERINGLIMITER_MIN_LOUDNESS :: 1

    FXMASTERINGLIMITER_MIN_LOUDNESS ¶

    FXMASTERINGLIMITER_MIN_LOUDNESS :: FXLOUDNESS_DEFAULT_MOMENTARY_MS
     

    Loudness defaults used with FXLoudness:

    FXMASTERINGLIMITER_MIN_RELEASE ¶

    FXMASTERINGLIMITER_MIN_RELEASE :: 1
     

    Mastering limiter parameter bounds (inclusive), used with FXMasteringLimiter:

    FXMasteringLimiter_UUID ¶

    FXMasteringLimiter_UUID :: USE_DEFAULT_PROCESSOR
     

    ANY_PROCESSOR :: 0xffffffff

    FXMasteringLimiter_UUID_STRING ¶

    FXMasteringLimiter_UUID_STRING :: "C4137916-2BE1-46FD-8599-441536F49856"

    FXREVERB_DEFAULT_DIFFUSION ¶

    FXREVERB_DEFAULT_DIFFUSION :: 0.9

    FXREVERB_DEFAULT_ROOMSIZE ¶

    FXREVERB_DEFAULT_ROOMSIZE :: 0.6

    FXREVERB_MAX_DIFFUSION ¶

    FXREVERB_MAX_DIFFUSION :: 1.0

    FXREVERB_MIN_DIFFUSION ¶

    FXREVERB_MIN_DIFFUSION :: 0.0
     

    Reverb parameter bounds (inclusive), used with FXReverb:

    FXREVERB_MIN_ROOMSIZE ¶

    FXREVERB_MIN_ROOMSIZE :: 0.0001

    FXReverb_UUID_STRING ¶

    FXReverb_UUID_STRING :: "7D9ACA56-CB68-4807-B632-B137352E8596"

    FrequencyRatioToSemitones ¶

    FrequencyRatioToSemitones :: MAX_AUDIO_CHANNELS
     

    Maximum channels in an audio stream

    HANDLE_BYTESIZE ¶

    HANDLE_BYTESIZE :: 20
     

    size of instance handle in bytes

    HRTF_DEFAULT_CUTOFF_DISTANCE ¶

    HRTF_DEFAULT_CUTOFF_DISTANCE :: 3.402823466e+38

    HRTF_DEFAULT_UNITY_GAIN_DISTANCE ¶

    HRTF_DEFAULT_UNITY_GAIN_DISTANCE :: 1.0

    HRTF_MAX_GAIN_LIMIT ¶

    HRTF_MAX_GAIN_LIMIT :: 12.0

    HRTF_MIN_GAIN_LIMIT ¶

    HRTF_MIN_GAIN_LIMIT :: -96.0

    HRTF_MIN_UNITY_GAIN_DISTANCE ¶

    HRTF_MIN_UNITY_GAIN_DISTANCE :: 0.05

    HrtfDirectivityCardioid ¶

    HrtfDirectivityCardioid :: INVALID_OPSET
     

    Not allowed for OperationSet arguments

    I3DL2_PRESET_PLATE ¶

    I3DL2_PRESET_PLATE :: FXECHO_MIN_WETDRYMIX
     

    Echo initialization data/parameter bounds (inclusive), used with FXEcho:

    INVALID_CALL ¶

    INVALID_CALL :: HRESULT(-2003435519)
     

    XAudio2 error codes

    IXAPOHrtfParameters_UUID_STRING ¶

    IXAPOHrtfParameters_UUID_STRING :: "15B3CD66-E9DE-4464-B6E6-2BC3CF63D455"
     

    ! The interface used to set parameters that control how HRTF is applied to a sound.

    IXAPOParameters_UUID_STRING ¶

    IXAPOParameters_UUID_STRING :: "26D95C66-80F2-499A-AD54-5AE7F01C6D98"
     

    IXAPOParameters: Optional XAPO COM interface that allows an XAPO to use effect-specific parameters.

    IXAPO_UUID_STRING ¶

    IXAPO_UUID_STRING :: "A410B984-9839-4819-A0BE-2856AE6B3ADB"

    IXAudio2Extension_UUID_STRING ¶

    IXAudio2Extension_UUID_STRING :: "84ac29bb-d619-44d2-b197-e4acf7df3ed6"
     

    This interface extends IXAudio2 with additional functionality. Use IXAudio2.QueryInterface to obtain a pointer to this interface.

    IXAudio2_UUID ¶

    IXAudio2_UUID :: MAX_SAMPLE_RATE
     

    Maximum audio sample rate supported

    IXAudio2_UUID_STRING ¶

    IXAudio2_UUID_STRING :: "2B02E3CF-2E0B-4ec3-BE45-1B2A3FE7210D"

    LOOP_INFINITE ¶

    LOOP_INFINITE :: 255
     

    Used in BUFFER.LoopCount

    MAX_BUFFERS_SYSTEM ¶

    MAX_BUFFERS_SYSTEM :: 2
     

    Maximum buffers allowed for system threads (Xbox 360 only)

    MAX_BUFFER_BYTES ¶

    MAX_BUFFER_BYTES :: 0x80000000
     

    Numeric boundary values

    MAX_FILTER_FREQUENCY ¶

    MAX_FILTER_FREQUENCY :: 1.0
     

    Maximum FILTER_PARAMETERS.Frequency

    MAX_FILTER_ONEOVERQ ¶

    MAX_FILTER_ONEOVERQ :: 1.5
     

    Maximum FILTER_PARAMETERS.OneOverQ

    MAX_FREQ_RATIO ¶

    MAX_FREQ_RATIO :: 1024.0
     

    Maximum MaxFrequencyRatio argument

    MAX_FREQ_RATIO ¶

    MAX_FREQ_RATIO :: MAX_RATIO_TIMES_RATE_XMA_MONO
     

    For XMA voices on Xbox 360 there is an additional restriction on the MaxFrequencyRatio argument and the voice's sample rate: the product of these numbers cannot exceed 600000 for one-channel voices or 300000 for voices with more than one channel.

    MAX_INSTANCES ¶

    MAX_INSTANCES :: 8
     

    Maximum simultaneous XAudio2 objects on Xbox 360

    MAX_LOOP_COUNT ¶

    MAX_LOOP_COUNT :: 254
     

    Maximum non-infinite BUFFER.LoopCount

    MAX_QUEUED_BUFFERS ¶

    MAX_QUEUED_BUFFERS :: 64
     

    Maximum buffers allowed in a voice queue

    MAX_RATIO_TIMES_RATE_XMA_MULTICHANNEL ¶

    MAX_RATIO_TIMES_RATE_XMA_MULTICHANNEL :: 300000

    MAX_VOLUME_LEVEL ¶

    MAX_VOLUME_LEVEL :: 16777216.0
     

    Maximum acceptable volume level (2^24)

    MIN_FREQ_RATIO ¶

    MIN_FREQ_RATIO :: 1.0 / 1024.0
     

    Minimum SetFrequencyRatio argument

    MIN_SAMPLE_RATE ¶

    MIN_SAMPLE_RATE :: 1000
     

    Minimum audio sample rate supported

    QUANTUM_DENOMINATOR ¶

    QUANTUM_DENOMINATOR :: 100
     

    in 10ms chunks (= 1/100 seconds)

    QUANTUM_MS ¶

    QUANTUM_MS :: 1000.0 * QUANTUM_NUMERATOR / QUANTUM_DENOMINATOR

    QUANTUM_NUMERATOR ¶

    QUANTUM_NUMERATOR :: 1
     

    Internal XAudio2 constants The audio frame quantum can be calculated by reducing the fraction: SamplesPerAudioFrame / SamplesPerSecond

    REVERB_DEFAULT_7POINT1_REAR_DELAY ¶

    REVERB_DEFAULT_7POINT1_REAR_DELAY :: 20

    REVERB_DEFAULT_7POINT1_SIDE_DELAY ¶

    REVERB_DEFAULT_7POINT1_SIDE_DELAY :: 5

    REVERB_DEFAULT_EARLY_DIFFUSION ¶

    REVERB_DEFAULT_EARLY_DIFFUSION :: 8

    REVERB_DEFAULT_HIGH_EQ_GAIN ¶

    REVERB_DEFAULT_HIGH_EQ_GAIN :: 8

    REVERB_DEFAULT_LATE_DIFFUSION ¶

    REVERB_DEFAULT_LATE_DIFFUSION :: 8

    REVERB_DEFAULT_LOW_EQ_CUTOFF ¶

    REVERB_DEFAULT_LOW_EQ_CUTOFF :: 4

    REVERB_DEFAULT_LOW_EQ_GAIN ¶

    REVERB_DEFAULT_LOW_EQ_GAIN :: 8

    REVERB_DEFAULT_POSITION ¶

    REVERB_DEFAULT_POSITION :: 6

    REVERB_DEFAULT_REAR_DELAY ¶

    REVERB_DEFAULT_REAR_DELAY :: 5

    REVERB_DEFAULT_REFLECTIONS_DELAY ¶

    REVERB_DEFAULT_REFLECTIONS_DELAY :: 5

    REVERB_DEFAULT_REFLECTIONS_GAIN ¶

    REVERB_DEFAULT_REFLECTIONS_GAIN :: 0.0

    REVERB_DEFAULT_REVERB_DELAY ¶

    REVERB_DEFAULT_REVERB_DELAY :: 5

    REVERB_DEFAULT_REVERB_GAIN ¶

    REVERB_DEFAULT_REVERB_GAIN :: 0.0

    REVERB_DEFAULT_ROOM_FILTER_FREQ ¶

    REVERB_DEFAULT_ROOM_FILTER_FREQ :: 5000.0

    REVERB_DEFAULT_ROOM_FILTER_HF ¶

    REVERB_DEFAULT_ROOM_FILTER_HF :: 0.0

    REVERB_DEFAULT_ROOM_FILTER_MAIN ¶

    REVERB_DEFAULT_ROOM_FILTER_MAIN :: 0.0

    REVERB_DEFAULT_ROOM_SIZE ¶

    REVERB_DEFAULT_ROOM_SIZE :: 100.0

    REVERB_DEFAULT_WET_DRY_MIX ¶

    REVERB_DEFAULT_WET_DRY_MIX :: 100.0

    REVERB_MAX_7POINT1_REAR_DELAY ¶

    REVERB_MAX_7POINT1_REAR_DELAY :: 20

    REVERB_MAX_7POINT1_SIDE_DELAY ¶

    REVERB_MAX_7POINT1_SIDE_DELAY :: 5

    REVERB_MAX_DIFFUSION ¶

    REVERB_MAX_DIFFUSION :: 15

    REVERB_MAX_FRAMERATE ¶

    REVERB_MAX_FRAMERATE :: 48000

    REVERB_MAX_HIGH_EQ_CUTOFF ¶

    REVERB_MAX_HIGH_EQ_CUTOFF :: 14

    REVERB_MAX_HIGH_EQ_GAIN ¶

    REVERB_MAX_HIGH_EQ_GAIN :: 8

    REVERB_MAX_LOW_EQ_GAIN ¶

    REVERB_MAX_LOW_EQ_GAIN :: 12

    REVERB_MAX_REAR_DELAY ¶

    REVERB_MAX_REAR_DELAY :: 5

    REVERB_MAX_REFLECTIONS_DELAY ¶

    REVERB_MAX_REFLECTIONS_DELAY :: 300

    REVERB_MAX_REFLECTIONS_GAIN ¶

    REVERB_MAX_REFLECTIONS_GAIN :: 20.0

    REVERB_MAX_REVERB_DELAY ¶

    REVERB_MAX_REVERB_DELAY :: 85

    REVERB_MAX_REVERB_GAIN ¶

    REVERB_MAX_REVERB_GAIN :: 20.0

    REVERB_MAX_ROOM_FILTER_MAIN ¶

    REVERB_MAX_ROOM_FILTER_MAIN :: 0.0

    REVERB_MAX_ROOM_SIZE ¶

    REVERB_MAX_ROOM_SIZE :: 100.0

    REVERB_MAX_WET_DRY_MIX ¶

    REVERB_MAX_WET_DRY_MIX :: 100.0

    REVERB_MIN_7POINT1_REAR_DELAY ¶

    REVERB_MIN_7POINT1_REAR_DELAY :: 0

    REVERB_MIN_7POINT1_SIDE_DELAY ¶

    REVERB_MIN_7POINT1_SIDE_DELAY :: 0

    REVERB_MIN_DECAY_TIME ¶

    REVERB_MIN_DECAY_TIME :: 0.1

    REVERB_MIN_DIFFUSION ¶

    REVERB_MIN_DIFFUSION :: 0

    REVERB_MIN_FRAMERATE ¶

    REVERB_MIN_FRAMERATE :: 20000

    REVERB_MIN_HIGH_EQ_CUTOFF ¶

    REVERB_MIN_HIGH_EQ_CUTOFF :: 0

    REVERB_MIN_HIGH_EQ_GAIN ¶

    REVERB_MIN_HIGH_EQ_GAIN :: 0

    REVERB_MIN_LOW_EQ_CUTOFF ¶

    REVERB_MIN_LOW_EQ_CUTOFF :: 0

    REVERB_MIN_LOW_EQ_GAIN ¶

    REVERB_MIN_LOW_EQ_GAIN :: 0

    REVERB_MIN_POSITION ¶

    REVERB_MIN_POSITION :: 0

    REVERB_MIN_REAR_DELAY ¶

    REVERB_MIN_REAR_DELAY :: 0

    REVERB_MIN_REFLECTIONS_DELAY ¶

    REVERB_MIN_REFLECTIONS_DELAY :: 0

    REVERB_MIN_REFLECTIONS_GAIN ¶

    REVERB_MIN_REFLECTIONS_GAIN :: -100.0

    REVERB_MIN_REVERB_DELAY ¶

    REVERB_MIN_REVERB_DELAY :: 0

    REVERB_MIN_REVERB_GAIN ¶

    REVERB_MIN_REVERB_GAIN :: -100.0

    REVERB_MIN_ROOM_FILTER_FREQ ¶

    REVERB_MIN_ROOM_FILTER_FREQ :: 20.0

    REVERB_MIN_ROOM_FILTER_HF ¶

    REVERB_MIN_ROOM_FILTER_HF :: -100.0

    REVERB_MIN_ROOM_FILTER_MAIN ¶

    REVERB_MIN_ROOM_FILTER_MAIN :: -100.0

    REVERB_MIN_WET_DRY_MIX ¶

    REVERB_MIN_WET_DRY_MIX :: DEVICE_INVALIDATED
     

    0x88960004 An audio device became unusable (unplugged, etc)

    SPEAKER_5POINT1 ¶

    SPEAKER_5POINT1 :: SPEAKER_FLAGS{.FRONT_LEFT, .FRONT_RIGHT, .FRONT_CENTER, .LOW_FREQUENCY, .BACK_LEFT, .BACK_RIGHT}

    SPEAKER_7POINT1_SURROUND ¶

    SPEAKER_7POINT1_SURROUND :: SPEAKER_FLAGS{.FRONT_LEFT, .FRONT_RIGHT, .FRONT_CENTER, .LOW_FREQUENCY, .BACK_LEFT, .BACK_RIGHT, .SIDE_LEFT, .SIDE_RIGHT}

    SPEAKER_MONO ¶

    SPEAKER_MONO :: SPEAKER_FLAGS{.FRONT_CENTER}
     

    standard speaker geometry configurations, used with Initialize

    SPEAKER_QUAD ¶

    SPEAKER_QUAD :: SPEAKER_FLAGS{.FRONT_LEFT, .FRONT_RIGHT, .BACK_LEFT, .BACK_RIGHT}

    SPEAKER_STEREO ¶

    SPEAKER_STEREO :: SPEAKER_FLAGS{.FRONT_LEFT, .FRONT_RIGHT}

    SPEAKER_SURROUND ¶

    SPEAKER_SURROUND :: SPEAKER_FLAGS{.FRONT_LEFT, .FRONT_RIGHT, .FRONT_CENTER, .BACK_CENTER}

    SPEED_OF_SOUND ¶

    SPEED_OF_SOUND :: 343.5
     

    speed of sound in meters per second for dry air at approximately 20C, used with Initialize

    VOICE_SENDS ¶

    VOICE_SENDS :: NO_LOOP_REGION
     

    Used in BUFFER.LoopCount

    XAPO_CREATION_FAILED ¶

    XAPO_CREATION_FAILED :: HRESULT(-2003435517)
     

    0x88960003 XAudio2 failed to initialize an XAPO effect

    XAPO_MAX_CHANNELS ¶

    XAPO_MAX_CHANNELS :: 64

    XAPO_MAX_FRAMERATE ¶

    XAPO_MAX_FRAMERATE :: 200000

    XAPO_MIN_CHANNELS ¶

    XAPO_MIN_CHANNELS :: 1
     

    supported number of channels (samples per frame) range

    XAPO_MIN_FRAMERATE ¶

    XAPO_MIN_FRAMERATE :: 1000
     

    supported framerate range

    XAPO_REGISTRATION_STRING_LENGTH ¶

    XAPO_REGISTRATION_STRING_LENGTH :: 256
     

    unicode string length, including terminator, used with XAPO_REGISTRATION_PROPERTIES

    XMA_DECODER_ERROR ¶

    XMA_DECODER_ERROR :: HRESULT(-2003435518)
     

    0x88960002 The XMA hardware suffered an unrecoverable error

    Variables

    Default_DirectionalCone ¶

    Default_DirectionalCone: CONE = …

    Default_LinearCurve ¶

    Default_LinearCurve: DISTANCE_CURVE = …

    Default_LinearCurvePoints ¶

    Default_LinearCurvePoints: [2]DISTANCE_CURVE_POINT = …

    FORMAT_UNSUPPORTED ¶

    FORMAT_UNSUPPORTED: sys_windows.HRESULT = …
     

    requested audio format unsupported

    FXEQ_UUID ¶

    FXEQ_UUID: ^sys_windows.GUID = …

    FXEcho_UUID ¶

    FXEcho_UUID: ^sys_windows.GUID = …

    FXMasteringLimiter_UUID ¶

    FXMasteringLimiter_UUID: ^sys_windows.GUID = …

    IXAPOHrtfParameters_UUID ¶

    IXAPOHrtfParameters_UUID: ^sys_windows.GUID = …

    IXAPOParameters_UUID ¶

    IXAPOParameters_UUID: ^sys_windows.GUID = …

    IXAPO_UUID ¶

    IXAPO_UUID: ^sys_windows.GUID = …

    Procedures

    AmplitudeRatioToDecibels ¶

    AmplitudeRatioToDecibels :: proc "contextless" (Volume: f32) -> f32 {…}
     

    Recover a volume in decibels from an amplitude factor

    BUFFER ¶

    BUFFER :: CreateFX
     

    creates instance of requested XAPO, use Release to free instance pInitData - [in] effect-specific initialization parameters, may be nil if InitDataByteSize == 0 InitDataByteSize - [in] size of pInitData in bytes, may be 0 if pInitData is nil

    Calculate ¶

    Calculate :: proc "c" (Instance: HANDLE, #by_ptr pListener: LISTENER, #by_ptr pEmitter: EMITTER, Flags: CALCULATE_FLAGS, pDSPSettings: ^DSP_SETTINGS) ---
     

    calculates DSP settings with respect to 3D parameters

    Create ¶

    Create :: proc "stdcall" (ppXaudio2: ^^IXAudio2, Flags: FLAGS = {}, Processor: PROCESSOR_FLAGS = {.Processor1}) -> sys_windows.HRESULT ---

    CutoffFrequencyToOnePoleCoefficient ¶

    CutoffFrequencyToOnePoleCoefficient :: proc "contextless" (CutoffFrequency: f32, SampleRate: u32) -> f32 {…}
     

    Convert from filter cutoff frequencies expressed in Hertz to the filter coefficients used with FILTER_PARAMETERS.Frequency, LowPassOnePoleFilter and HighPassOnePoleFilter filter types only. Use CutoffFrequencyToRadians() for state-variable filter types.

    CutoffFrequencyToRadians ¶

    CutoffFrequencyToRadians :: proc "contextless" (CutoffFrequency: f32, SampleRate: u32) -> f32 {…}
     

    Convert from filter cutoff frequencies expressed in Hertz to the radian frequency values used in FILTER_PARAMETERS.Frequency, state-variable filter types only. Use CutoffFrequencyToOnePoleCoefficient() for one-pole filter types. Note that the highest CutoffFrequency supported is SampleRate/6. Higher values of CutoffFrequency will return MAX_FILTER_FREQUENCY.

    DecibelsToAmplitudeRatio ¶

    DecibelsToAmplitudeRatio :: proc "contextless" (Decibels: f32) -> f32 {…}
     

    Calculate the argument to SetVolume from a decibel value

    FXREVERB_DEFAULT_ROOMSIZE ¶

    FXREVERB_DEFAULT_ROOMSIZE :: FrequencyRatioToSemitones
     

    Recover a pitch in semitones from a frequency ratio

    Initialize ¶

    Initialize :: proc "c" (SpeakerChannelMask: sys_windows.SPEAKER_FLAGS, SpeedOfSound: f32, Instance: HANDLE) -> sys_windows.HRESULT ---
     

    initializes instance handle

    RadiansToCutoffFrequency ¶

    RadiansToCutoffFrequency :: proc "contextless" (Radians: f32, SampleRate: f32) -> f32 {…}
     

    Convert from radian frequencies back to absolute frequencies in Hertz

    ReverbConvertI3DL2ToNative ¶

    ReverbConvertI3DL2ToNative :: proc "contextless" (pI3DL2: ^REVERB_I3DL2_PARAMETERS, pNative: ^REVERB_PARAMETERS, sevenDotOneReverb: b32 = true) {…}

    SemitonesToFrequencyRatio ¶

    SemitonesToFrequencyRatio :: proc "contextless" (Semitones: f32) -> f32 {…}
     

    Calculate the argument to SetFrequencyRatio from a semitone value

    Procedure Groups

    This section is empty.

    Source Files

    Generation Information

    Generated with odin version dev-2026-03 (vendor "odin") Windows_amd64 @ 2026-03-19 18:57:33.664237700 +0000 UTC