mirror of
https://github.com/mackron/miniaudio.git
synced 2026-04-23 16:54:03 +02:00
Web Audio: Minor change for multi-threaded mode.
This commit is contained in:
+6
-2
@@ -42914,9 +42914,10 @@ static void ma_audio_worklet_processor_created__webaudio(EMSCRIPTEN_WEBAUDIO_T a
|
|||||||
sampleRate = EM_ASM_INT({ return emscriptenGetAudioObject($0).sampleRate; }, audioContext);
|
sampleRate = EM_ASM_INT({ return emscriptenGetAudioObject($0).sampleRate; }, audioContext);
|
||||||
|
|
||||||
/*
|
/*
|
||||||
We're now going to choose a period size. The quantum size reported by Web Audio is too small for us to use so
|
We're now going to choose a period size. For single-threaded mode, the quantum size reported by Web Audio is too small
|
||||||
we'll need to use something bigger for our internal bufferring.
|
for us to use so we'll need to use something bigger for our internal bufferring.
|
||||||
*/
|
*/
|
||||||
|
if (ma_device_get_threading_mode(pParameters->pDevice) == MA_THREADING_MODE_SINGLE_THREADED) {
|
||||||
chosenPeriodSizeInFrames = intermediaryBufferSizeInFrames;
|
chosenPeriodSizeInFrames = intermediaryBufferSizeInFrames;
|
||||||
if (pParameters->pDescriptorCapture != NULL) {
|
if (pParameters->pDescriptorCapture != NULL) {
|
||||||
if (chosenPeriodSizeInFrames < pParameters->pDescriptorCapture->periodSizeInFrames) {
|
if (chosenPeriodSizeInFrames < pParameters->pDescriptorCapture->periodSizeInFrames) {
|
||||||
@@ -42933,6 +42934,9 @@ static void ma_audio_worklet_processor_created__webaudio(EMSCRIPTEN_WEBAUDIO_T a
|
|||||||
if (chosenPeriodSizeInFrames < 1024) {
|
if (chosenPeriodSizeInFrames < 1024) {
|
||||||
chosenPeriodSizeInFrames = 1024;
|
chosenPeriodSizeInFrames = 1024;
|
||||||
}
|
}
|
||||||
|
} else {
|
||||||
|
chosenPeriodSizeInFrames = intermediaryBufferSizeInFrames;
|
||||||
|
}
|
||||||
|
|
||||||
if (pParameters->pDescriptorCapture != NULL) {
|
if (pParameters->pDescriptorCapture != NULL) {
|
||||||
pParameters->pDescriptorCapture->format = ma_format_f32;
|
pParameters->pDescriptorCapture->format = ma_format_f32;
|
||||||
|
|||||||
Reference in New Issue
Block a user