mirror of
https://github.com/mackron/miniaudio.git
synced 2026-04-23 00:34:03 +02:00
Merge branch 'dev' into dev-0.12
This commit is contained in:
@@ -11114,6 +11114,7 @@ typedef struct
|
|||||||
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 gainSmoothTimeInFrames; /* 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 gainSmoothTimeInMilliseconds; /* When set to 0, gainSmoothTimeInFrames 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_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(). */
|
||||||
ma_bool32 noDevice; /* When set to true, don't create a default device. ma_engine_read_pcm_frames() can be called manually to read data. */
|
ma_bool32 noDevice; /* When set to true, don't create a default device. ma_engine_read_pcm_frames() can be called manually to read data. */
|
||||||
@@ -11144,6 +11145,7 @@ struct ma_engine
|
|||||||
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 gainSmoothTimeInFrames; /* The number of frames to interpolate the gain of spatialized sounds across. */
|
||||||
|
ma_uint32 defaultVolumeSmoothTimeInPCMFrames;
|
||||||
ma_mono_expansion_mode monoExpansionMode;
|
ma_mono_expansion_mode monoExpansionMode;
|
||||||
};
|
};
|
||||||
|
|
||||||
@@ -74400,6 +74402,7 @@ MA_API ma_result ma_engine_init(const ma_engine_config* pConfig, ma_engine* pEng
|
|||||||
}
|
}
|
||||||
|
|
||||||
pEngine->monoExpansionMode = engineConfig.monoExpansionMode;
|
pEngine->monoExpansionMode = engineConfig.monoExpansionMode;
|
||||||
|
pEngine->defaultVolumeSmoothTimeInPCMFrames = engineConfig.defaultVolumeSmoothTimeInPCMFrames;
|
||||||
ma_allocation_callbacks_init_copy(&pEngine->allocationCallbacks, &engineConfig.allocationCallbacks);
|
ma_allocation_callbacks_init_copy(&pEngine->allocationCallbacks, &engineConfig.allocationCallbacks);
|
||||||
|
|
||||||
#if !defined(MA_NO_RESOURCE_MANAGER)
|
#if !defined(MA_NO_RESOURCE_MANAGER)
|
||||||
@@ -75214,6 +75217,10 @@ static ma_result ma_sound_init_from_data_source_internal(ma_engine* pEngine, con
|
|||||||
engineNodeConfig.volumeSmoothTimeInPCMFrames = pConfig->volumeSmoothTimeInPCMFrames;
|
engineNodeConfig.volumeSmoothTimeInPCMFrames = pConfig->volumeSmoothTimeInPCMFrames;
|
||||||
engineNodeConfig.monoExpansionMode = pConfig->monoExpansionMode;
|
engineNodeConfig.monoExpansionMode = pConfig->monoExpansionMode;
|
||||||
|
|
||||||
|
if (engineNodeConfig.volumeSmoothTimeInPCMFrames == 0) {
|
||||||
|
engineNodeConfig.volumeSmoothTimeInPCMFrames = pEngine->defaultVolumeSmoothTimeInPCMFrames;
|
||||||
|
}
|
||||||
|
|
||||||
/* If we're loading from a data source the input channel count needs to be the data source's native channel count. */
|
/* If we're loading from a data source the input channel count needs to be the data source's native channel count. */
|
||||||
if (pConfig->pDataSource != NULL) {
|
if (pConfig->pDataSource != NULL) {
|
||||||
result = ma_data_source_get_data_format(pConfig->pDataSource, NULL, &engineNodeConfig.channelsIn, &engineNodeConfig.sampleRate, NULL, 0);
|
result = ma_data_source_get_data_format(pConfig->pDataSource, NULL, &engineNodeConfig.channelsIn, &engineNodeConfig.sampleRate, NULL, 0);
|
||||||
@@ -75432,6 +75439,7 @@ MA_API ma_result ma_sound_init_copy(ma_engine* pEngine, const ma_sound* pExistin
|
|||||||
config.flags = flags;
|
config.flags = flags;
|
||||||
config.pInitialAttachment = pGroup;
|
config.pInitialAttachment = pGroup;
|
||||||
config.monoExpansionMode = pExistingSound->engineNode.monoExpansionMode;
|
config.monoExpansionMode = pExistingSound->engineNode.monoExpansionMode;
|
||||||
|
config.volumeSmoothTimeInPCMFrames = pExistingSound->engineNode.volumeSmoothTimeInPCMFrames;
|
||||||
config.pNotifications = pNotifications;
|
config.pNotifications = pNotifications;
|
||||||
|
|
||||||
result = ma_sound_init_from_data_source_internal(pEngine, &config, pSound);
|
result = ma_sound_init_from_data_source_internal(pEngine, &config, pSound);
|
||||||
|
|||||||
Reference in New Issue
Block a user