mirror of
https://github.com/mackron/miniaudio.git
synced 2026-04-24 01:04:02 +02:00
API CHANGE: Rename a variable.
This renames `gainSmoothTimeInFrames` in `ma_engine_config` to `spatializationVolumeSmoothTimeInFrames` in order to make it more clear that it specifically affects spatialization.
This commit is contained in:
+11
-11
@@ -11358,9 +11358,9 @@ typedef struct
|
|||||||
ma_uint32 sampleRate; /* The sample rate. When set to 0 will use the native channel count of the device. */
|
ma_uint32 sampleRate; /* The sample rate. When set to 0 will use the native channel count of the device. */
|
||||||
ma_uint32 periodSizeInFrames; /* If set to something other than 0, updates will always be exactly this size. The underlying device may be a different size, but from the perspective of the mixer that won't matter.*/
|
ma_uint32 periodSizeInFrames; /* If set to something other than 0, updates will always be exactly this size. The underlying device may be a different size, but from the perspective of the mixer that won't matter.*/
|
||||||
ma_uint32 periodSizeInMilliseconds; /* Used if periodSizeInFrames is unset. */
|
ma_uint32 periodSizeInMilliseconds; /* Used if periodSizeInFrames is unset. */
|
||||||
ma_uint32 gainSmoothTimeInFrames; /* The number of frames to interpolate the gain of spatialized sounds across. If set to 0, will use gainSmoothTimeInMilliseconds. */
|
ma_uint32 spatializationVolumeSmoothTimeInFrames; /* The number of frames to interpolate the gain of spatialized sounds across. If set to 0, will use gainSmoothTimeInMilliseconds. */
|
||||||
ma_uint32 gainSmoothTimeInMilliseconds; /* When set to 0, gainSmoothTimeInFrames will be used. If both are set to 0, a default value will be used. */
|
ma_uint32 spatializationVolumeSmoothTimeInMilliseconds; /* When set to 0, spatializationVolumeSmoothTimeInFrames will be used. If both are set to 0, a default value will be used. */
|
||||||
ma_uint32 defaultVolumeSmoothTimeInPCMFrames; /* Defaults to 0. Controls the default amount of smoothing to apply to volume changes to sounds. High values means more smoothing at the expense of high latency (will take longer to reach the new volume). */
|
ma_uint32 defaultVolumeSmoothTimeInPCMFrames; /* Defaults to 0. Controls the default amount of smoothing to apply to volume changes to sounds. Higher values means more smoothing at the expense of higher latency (will take longer to reach the new volume). */
|
||||||
ma_uint32 preMixStackSizeInBytes; /* A stack is used for internal processing in the node graph. This allows you to configure the size of this stack. Smaller values will reduce the maximum depth of your node graph. You should rarely need to modify this. */
|
ma_uint32 preMixStackSizeInBytes; /* A stack is used for internal processing in the node graph. This allows you to configure the size of this stack. Smaller values will reduce the maximum depth of your node graph. You should rarely need to modify this. */
|
||||||
ma_allocation_callbacks allocationCallbacks;
|
ma_allocation_callbacks allocationCallbacks;
|
||||||
ma_bool32 noAutoStart; /* When set to true, requires an explicit call to ma_engine_start(). This is false by default, meaning the engine will be started automatically in ma_engine_init(). */
|
ma_bool32 noAutoStart; /* When set to true, requires an explicit call to ma_engine_start(). This is false by default, meaning the engine will be started automatically in ma_engine_init(). */
|
||||||
@@ -11393,7 +11393,7 @@ struct ma_engine
|
|||||||
ma_spinlock inlinedSoundLock; /* For synchronizing access to the inlined sound list. */
|
ma_spinlock inlinedSoundLock; /* For synchronizing access to the inlined sound list. */
|
||||||
ma_sound_inlined* pInlinedSoundHead; /* The first inlined sound. Inlined sounds are tracked in a linked list. */
|
ma_sound_inlined* pInlinedSoundHead; /* The first inlined sound. Inlined sounds are tracked in a linked list. */
|
||||||
MA_ATOMIC(4, ma_uint32) inlinedSoundCount; /* The total number of allocated inlined sound objects. Used for debugging. */
|
MA_ATOMIC(4, ma_uint32) inlinedSoundCount; /* The total number of allocated inlined sound objects. Used for debugging. */
|
||||||
ma_uint32 gainSmoothTimeInFrames; /* The number of frames to interpolate the gain of spatialized sounds across. */
|
ma_uint32 spatializationVolumeSmoothTimeInFrames; /* The number of frames to interpolate the gain of spatialized sounds across. */
|
||||||
ma_uint32 defaultVolumeSmoothTimeInPCMFrames;
|
ma_uint32 defaultVolumeSmoothTimeInPCMFrames;
|
||||||
ma_mono_expansion_mode monoExpansionMode;
|
ma_mono_expansion_mode monoExpansionMode;
|
||||||
ma_engine_process_proc onProcess;
|
ma_engine_process_proc onProcess;
|
||||||
@@ -74699,7 +74699,7 @@ MA_API ma_result ma_engine_node_init_preallocated(const ma_engine_node_config* p
|
|||||||
ensure channels counts link up correctly in the node graph.
|
ensure channels counts link up correctly in the node graph.
|
||||||
*/
|
*/
|
||||||
spatializerConfig = ma_engine_node_spatializer_config_init(&baseNodeConfig);
|
spatializerConfig = ma_engine_node_spatializer_config_init(&baseNodeConfig);
|
||||||
spatializerConfig.gainSmoothTimeInFrames = pEngineNode->pEngine->gainSmoothTimeInFrames;
|
spatializerConfig.gainSmoothTimeInFrames = pEngineNode->pEngine->spatializationVolumeSmoothTimeInFrames;
|
||||||
|
|
||||||
if (spatializerConfig.channelsIn == 2) {
|
if (spatializerConfig.channelsIn == 2) {
|
||||||
spatializerConfig.pChannelMapIn = defaultStereoChannelMap;
|
spatializerConfig.pChannelMapIn = defaultStereoChannelMap;
|
||||||
@@ -75057,14 +75057,14 @@ MA_API ma_result ma_engine_init(const ma_engine_config* pConfig, ma_engine* pEng
|
|||||||
|
|
||||||
|
|
||||||
/* Gain smoothing for spatialized sounds. */
|
/* Gain smoothing for spatialized sounds. */
|
||||||
pEngine->gainSmoothTimeInFrames = engineConfig.gainSmoothTimeInFrames;
|
pEngine->spatializationVolumeSmoothTimeInFrames = engineConfig.spatializationVolumeSmoothTimeInFrames;
|
||||||
if (pEngine->gainSmoothTimeInFrames == 0) {
|
if (pEngine->spatializationVolumeSmoothTimeInFrames == 0) {
|
||||||
ma_uint32 gainSmoothTimeInMilliseconds = engineConfig.gainSmoothTimeInMilliseconds;
|
ma_uint32 spatializationVolumeSmoothTimeInMilliseconds = engineConfig.spatializationVolumeSmoothTimeInMilliseconds;
|
||||||
if (gainSmoothTimeInMilliseconds == 0) {
|
if (spatializationVolumeSmoothTimeInMilliseconds == 0) {
|
||||||
gainSmoothTimeInMilliseconds = 8;
|
spatializationVolumeSmoothTimeInMilliseconds = 8;
|
||||||
}
|
}
|
||||||
|
|
||||||
pEngine->gainSmoothTimeInFrames = (gainSmoothTimeInMilliseconds * ma_engine_get_sample_rate(pEngine)) / 1000; /* 8ms by default. */
|
pEngine->spatializationVolumeSmoothTimeInFrames = (spatializationVolumeSmoothTimeInMilliseconds * ma_engine_get_sample_rate(pEngine)) / 1000; /* 8ms by default. */
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user