/* SIMD alignment in bytes. Currently set to 32 bytes in preparation for future AVX optimizations. */
/* SIMD alignment in bytes. Currently set to 32 bytes in preparation for future AVX optimizations. */
#define MA_SIMD_ALIGNMENT 32
#define MA_SIMD_ALIGNMENT 32
...
@@ -1351,13 +1361,14 @@ typedef struct
...
@@ -1351,13 +1361,14 @@ typedef struct
floatvolumeBeg;/* If volumeBeg and volumeEnd is equal to 1, no fading happens (ma_fader_process_pcm_frames() will run as a passthrough). */
floatvolumeBeg;/* If volumeBeg and volumeEnd is equal to 1, no fading happens (ma_fader_process_pcm_frames() will run as a passthrough). */
floatvolumeEnd;
floatvolumeEnd;
ma_uint64lengthInFrames;/* The total length of the fade. */
ma_uint64lengthInFrames;/* The total length of the fade. */
ma_uint64cursorInFrames;/* The current time in frames. Incremented by ma_fader_process_pcm_frames(). */
ma_int64cursorInFrames;/* The current time in frames. Incremented by ma_fader_process_pcm_frames(). Signed because it'll be offset by startOffsetInFrames in set_fade_ex(). */
ma_resultinitResult;/* Set to MA_BUSY while initialization is in progress. */
size_tintermediaryBufferSizeInFramesCapture;
intdeviceIndex;/* We store the device in a list on the JavaScript side. This is used to map our C object to the JS object. */
float*pIntermediaryBufferPlayback;
float*pIntermediaryBufferCapture;
void*pStackBufferPlayback;
void*pStackBufferCapture;
ma_bool32isInitialized;
/* ScriptProcessorNode path. */
intindexPlayback;/* We use a factory on the JavaScript side to manage devices and use an index for JS/C interop. */
intindexCapture;
}webaudio;
}webaudio;
#endif
#endif
#ifdef MA_SUPPORT_NULL
#ifdef MA_SUPPORT_NULL
...
@@ -7374,6 +7378,15 @@ typedef struct
...
@@ -7374,6 +7378,15 @@ typedef struct
MA_ATOMIC(4,ma_bool32)isSpatializationDisabled;/* Set to false by default. When set to false, will not have spatialisation applied. */
MA_ATOMIC(4,ma_bool32)isSpatializationDisabled;/* Set to false by default. When set to false, will not have spatialisation applied. */
MA_ATOMIC(4,ma_uint32)pinnedListenerIndex;/* The index of the listener this node should always use for spatialization. If set to MA_LISTENER_INDEX_CLOSEST the engine will use the closest listener. */
MA_ATOMIC(4,ma_uint32)pinnedListenerIndex;/* The index of the listener this node should always use for spatialization. If set to MA_LISTENER_INDEX_CLOSEST the engine will use the closest listener. */
/* When setting a fade, it's not done immediately in ma_sound_set_fade(). It's deferred to the audio thread which means we need to store the settings here. */
struct
{
ma_atomic_floatvolumeBeg;
ma_atomic_floatvolumeEnd;
ma_atomic_uint64fadeLengthInFrames;/* <-- Defaults to (~(ma_uint64)0) which is used to indicate that no fade should be applied. */
ma_atomic_uint64absoluteGlobalTimeInFrames;/* <-- The time to start the fade. */
ma_device*pDevice;/* If set, the caller is responsible for calling ma_engine_data_callback() in the device's data callback. */
ma_device*pDevice;/* If set, the caller is responsible for calling ma_engine_data_callback() in the device's data callback. */
ma_device_id*pPlaybackDeviceID;/* The ID of the playback device to use with the default listener. */
ma_device_id*pPlaybackDeviceID;/* The ID of the playback device to use with the default listener. */
ma_device_data_procdataCallback;/* Can be null. Can be used to provide a custom device data callback. */
ma_device_notification_procnotificationCallback;
ma_device_notification_procnotificationCallback;
#endif
#endif
ma_log*pLog;/* When set to NULL, will use the context's log. */
ma_log*pLog;/* When set to NULL, will use the context's log. */
...
@@ -7479,6 +7495,8 @@ typedef struct
...
@@ -7479,6 +7495,8 @@ typedef struct
ma_bool32noDevice;/* When set to true, don't create a default device. ma_engine_read_pcm_frames() can be called manually to read data. */
ma_bool32noDevice;/* When set to true, don't create a default device. ma_engine_read_pcm_frames() can be called manually to read data. */
ma_mono_expansion_modemonoExpansionMode;/* Controls how the mono channel should be expanded to other channels when spatialization is disabled on a sound. */
ma_mono_expansion_modemonoExpansionMode;/* Controls how the mono channel should be expanded to other channels when spatialization is disabled on a sound. */
ma_vfs*pResourceManagerVFS;/* A pointer to a pre-allocated VFS object to use with the resource manager. This is ignored if pResourceManager is not NULL. */
ma_vfs*pResourceManagerVFS;/* A pointer to a pre-allocated VFS object to use with the resource manager. This is ignored if pResourceManager is not NULL. */
ma_engine_process_proconProcess;/* Fired at the end of each call to ma_engine_read_pcm_frames(). For engine's that manage their own internal device (the default configuration), this will be fired from the audio thread, and you do not need to call ma_engine_read_pcm_frames() manually in order to trigger this. */
void*pProcessUserData;/* User data that's passed into onProcess. */