volatilema_uint32encodedReadOffset;/* Most significant bit is the loop flag. Lower 31 bits contains the actual offset in bytes. */
MA_ATOMICma_uint32encodedReadOffset;/* Most significant bit is the loop flag. Lower 31 bits contains the actual offset in bytes. Must be used atomically. */
volatilema_uint32encodedWriteOffset;/* Most significant bit is the loop flag. Lower 31 bits contains the actual offset in bytes. */
MA_ATOMICma_uint32encodedWriteOffset;/* Most significant bit is the loop flag. Lower 31 bits contains the actual offset in bytes. Must be used atomically. */
ma_bool8ownsBuffer;/* Used to know whether or not miniaudio is responsible for free()-ing the buffer. */
ma_bool8ownsBuffer;/* Used to know whether or not miniaudio is responsible for free()-ing the buffer. */
ma_bool8clearOnWriteAcquire;/* When set, clears the acquired write buffer before returning from ma_rb_acquire_write(). */
ma_bool8clearOnWriteAcquire;/* When set, clears the acquired write buffer before returning from ma_rb_acquire_write(). */
ma_allocation_callbacksallocationCallbacks;
ma_allocation_callbacksallocationCallbacks;
}ma_rb;
}ma_rb;
...
@@ -1486,50 +1492,50 @@ This section contains the APIs for device playback and capture. Here is where yo
...
@@ -1486,50 +1492,50 @@ This section contains the APIs for device playback and capture. Here is where yo
volatilema_uint32state;/* The state of the device is variable and can change at any time on any thread, so tell the compiler as such with `volatile`. */
MA_ATOMICma_uint32state;/* The state of the device is variable and can change at any time on any thread. Must be used atomically. */
ma_device_callback_proconData;/* Set once at initialization time and should not be changed after. */
ma_device_callback_proconData;/* Set once at initialization time and should not be changed after. */
ma_stop_proconStop;/* Set once at initialization time and should not be changed after. */
ma_stop_proconStop;/* Set once at initialization time and should not be changed after. */
void*pUserData;/* Application defined data. */
void*pUserData;/* Application defined data. */
...
@@ -2497,7 +2503,7 @@ struct ma_device
...
@@ -2497,7 +2503,7 @@ struct ma_device
ma_bool8isOwnerOfContext;/* When set to true, uninitializing the device will also uninitialize the context. Set to true when NULL is passed into ma_device_init(). */
ma_bool8isOwnerOfContext;/* When set to true, uninitializing the device will also uninitialize the context. Set to true when NULL is passed into ma_device_init(). */
ma_bool8noPreZeroedOutputBuffer;
ma_bool8noPreZeroedOutputBuffer;
ma_bool8noClip;
ma_bool8noClip;
volatilefloatmasterVolumeFactor;/* Volatile so we can use some thread safety when applying volume to periods. */
MA_ATOMICfloatmasterVolumeFactor;/* Linear 0..1. Can be read and written simultaneously by different threads. Must be used atomically. */
ma_duplex_rbduplexRB;/* Intermediary buffer for duplex device on asynchronous backends. */
ma_duplex_rbduplexRB;/* Intermediary buffer for duplex device on asynchronous backends. */
struct
struct
{
{
...
@@ -2561,24 +2567,24 @@ struct ma_device
...
@@ -2561,24 +2567,24 @@ struct ma_device
/*IAudioClient**/ma_ptrpAudioClientCapture;
/*IAudioClient**/ma_ptrpAudioClientCapture;
/*IAudioRenderClient**/ma_ptrpRenderClient;
/*IAudioRenderClient**/ma_ptrpRenderClient;
/*IAudioCaptureClient**/ma_ptrpCaptureClient;
/*IAudioCaptureClient**/ma_ptrpCaptureClient;
/*IMMDeviceEnumerator**/ma_ptrpDeviceEnumerator;/* Used for IMMNotificationClient notifications. Required for detecting default device changes. */
/*IMMDeviceEnumerator**/ma_ptrpDeviceEnumerator;/* Used for IMMNotificationClient notifications. Required for detecting default device changes. */
ma_IMMNotificationClientnotificationClient;
ma_IMMNotificationClientnotificationClient;
/*HANDLE*/ma_handlehEventPlayback;/* Auto reset. Initialized to signaled. */
/*HANDLE*/ma_handlehEventPlayback;/* Auto reset. Initialized to signaled. */
/*HANDLE*/ma_handlehEventCapture;/* Auto reset. Initialized to unsignaled. */
/*HANDLE*/ma_handlehEventCapture;/* Auto reset. Initialized to unsignaled. */
ma_uint32actualPeriodSizeInFramesPlayback;/* 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. */
ma_uint32actualPeriodSizeInFramesPlayback;/* 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. */
ma_uint32actualPeriodSizeInFramesCapture;
ma_uint32actualPeriodSizeInFramesCapture;
ma_uint32originalPeriodSizeInFrames;
ma_uint32originalPeriodSizeInFrames;
ma_uint32originalPeriodSizeInMilliseconds;
ma_uint32originalPeriodSizeInMilliseconds;
ma_uint32originalPeriods;
ma_uint32originalPeriods;
ma_performance_profileoriginalPerformanceProfile;
ma_performance_profileoriginalPerformanceProfile;
volatilema_bool32hasDefaultPlaybackDeviceChanged;/* <-- Make sure this is always a whole 32-bits because we use atomic assignments. */
volatilema_bool32hasDefaultCaptureDeviceChanged;/* <-- Make sure this is always a whole 32-bits because we use atomic assignments. */
ma_uint32periodSizeInFramesPlayback;
ma_uint32periodSizeInFramesPlayback;
ma_uint32periodSizeInFramesCapture;
ma_uint32periodSizeInFramesCapture;
volatilema_bool32isStartedCapture;/* <-- Make sure this is always a whole 32-bits because we use atomic assignments. */
MA_ATOMICma_bool8hasDefaultPlaybackDeviceChanged;/* Can be read and written simultaneously across different threads. Must be used atomically. */
volatilema_bool32isStartedPlayback;/* <-- Make sure this is always a whole 32-bits because we use atomic assignments. */
MA_ATOMICma_bool8hasDefaultCaptureDeviceChanged;/* Can be read and written simultaneously across different threads. Must be used atomically. */
ma_bool8noAutoConvertSRC;/* When set to true, disables the use of AUDCLNT_STREAMFLAGS_AUTOCONVERTPCM. */
MA_ATOMICma_bool8isStartedCapture;/* Can be read and written simultaneously across different threads. Must be used atomically. */
ma_bool8noDefaultQualitySRC;/* When set to true, disables the use of AUDCLNT_STREAMFLAGS_SRC_DEFAULT_QUALITY. */
MA_ATOMICma_bool8isStartedPlayback;/* Can be read and written simultaneously across different threads. Must be used atomically. */
ma_bool8noAutoConvertSRC;/* When set to true, disables the use of AUDCLNT_STREAMFLAGS_AUTOCONVERTPCM. */
ma_bool8noDefaultQualitySRC;/* When set to true, disables the use of AUDCLNT_STREAMFLAGS_SRC_DEFAULT_QUALITY. */
ma_bool8noHardwareOffloading;
ma_bool8noHardwareOffloading;
ma_bool8allowCaptureAutoStreamRouting;
ma_bool8allowCaptureAutoStreamRouting;
ma_bool8allowPlaybackAutoStreamRouting;
ma_bool8allowPlaybackAutoStreamRouting;
...
@@ -2727,14 +2733,14 @@ struct ma_device
...
@@ -2727,14 +2733,14 @@ struct ma_device
ma_eventoperationCompletionEvent;
ma_eventoperationCompletionEvent;
ma_semaphoreoperationSemaphore;
ma_semaphoreoperationSemaphore;
ma_uint32operation;
ma_uint32operation;
volatilema_resultoperationResult;
ma_resultoperationResult;
ma_timertimer;
ma_timertimer;
doublepriorRunTime;
doublepriorRunTime;
ma_uint32currentPeriodFramesRemainingPlayback;
ma_uint32currentPeriodFramesRemainingPlayback;
ma_uint32currentPeriodFramesRemainingCapture;
ma_uint32currentPeriodFramesRemainingCapture;
ma_uint64lastProcessedFramePlayback;
ma_uint64lastProcessedFramePlayback;
ma_uint64lastProcessedFrameCapture;
ma_uint64lastProcessedFrameCapture;
volatilema_bool32isStarted;
MA_ATOMICma_bool8isStarted;/* Read and written by multiple threads. Must be used atomically. */
MA_APIma_resultma_data_source_get_length_in_pcm_frames(ma_data_source*pDataSource,ma_uint64*pLength);/* Returns MA_NOT_IMPLEMENTED if the length is unknown or cannot be determined. Decoders can return this. */
MA_APIma_resultma_data_source_get_length_in_pcm_frames(ma_data_source*pDataSource,ma_uint64*pLength);/* Returns MA_NOT_IMPLEMENTED if the length is unknown or cannot be determined. Decoders can return this. */
MA_APIma_resultma_audio_buffer_ref_unmap(ma_audio_buffer_ref*pAudioBufferRef,ma_uint64frameCount);/* Returns MA_AT_END if the end has been reached. This should be considered successful. */
@@ -4329,12 +4358,7 @@ MA_API ma_audio_buffer_config ma_audio_buffer_config_init(ma_format format, ma_u
...
@@ -4329,12 +4358,7 @@ MA_API ma_audio_buffer_config ma_audio_buffer_config_init(ma_format format, ma_u
typedefstruct
typedefstruct
{
{
ma_data_source_callbacksds;
ma_audio_buffer_refref;
ma_formatformat;
ma_uint32channels;
ma_uint64cursor;
ma_uint64sizeInFrames;
constvoid*pData;
ma_allocation_callbacksallocationCallbacks;
ma_allocation_callbacksallocationCallbacks;
ma_bool32ownsData;/* Used to control whether or not miniaudio owns the data buffer. If set to true, pData will be freed in ma_audio_buffer_uninit(). */
ma_bool32ownsData;/* Used to control whether or not miniaudio owns the data buffer. If set to true, pData will be freed in ma_audio_buffer_uninit(). */
ma_uint8_pExtraData[1];/* For allocating a buffer with the memory located directly after the other memory of the structure. */
ma_uint8_pExtraData[1];/* For allocating a buffer with the memory located directly after the other memory of the structure. */