Commit b53daca5 authored by David Reid's avatar David Reid

Clean up.

parent 1a7a9a7e
...@@ -40099,6 +40099,7 @@ typedef struct ...@@ -40099,6 +40099,7 @@ typedef struct
static EM_BOOL ma_audio_worklet_process_callback__webaudio(int inputCount, const AudioSampleFrame* pInputs, int outputCount, AudioSampleFrame* pOutputs, int paramCount, const AudioParamFrame* pParams, void* pUserData) static EM_BOOL ma_audio_worklet_process_callback__webaudio(int inputCount, const AudioSampleFrame* pInputs, int outputCount, AudioSampleFrame* pOutputs, int paramCount, const AudioParamFrame* pParams, void* pUserData)
{ {
ma_device* pDevice = (ma_device*)pUserData; ma_device* pDevice = (ma_device*)pUserData;
ma_uint32 frameCount;
(void)paramCount; (void)paramCount;
(void)pParams; (void)pParams;
...@@ -40111,13 +40112,14 @@ static EM_BOOL ma_audio_worklet_process_callback__webaudio(int inputCount, const ...@@ -40111,13 +40112,14 @@ static EM_BOOL ma_audio_worklet_process_callback__webaudio(int inputCount, const
Unfortunately the audio data is not interleaved so we'll need to convert it before we give the data to miniaudio Unfortunately the audio data is not interleaved so we'll need to convert it before we give the data to miniaudio
for further processing. for further processing.
*/ */
ma_uint32 frameCount = 128; frameCount = 128;
if (ma_device_get_state(pDevice) != ma_device_state_started) { if (ma_device_get_state(pDevice) != ma_device_state_started) {
/* Fill the output buffer with zero to avoid a noise sound */ /* Fill the output buffer with zero to avoid a noise sound */
for (int i = 0; i < outputCount; i += 1) { for (int i = 0; i < outputCount; i += 1) {
MA_ZERO_MEMORY(pOutputs[i].data, pOutputs[i].numberOfChannels * /*pOutputs[i].samplesPerChannel*/frameCount * sizeof(float)); MA_ZERO_MEMORY(pOutputs[i].data, pOutputs[i].numberOfChannels * frameCount * sizeof(float));
} }
return EM_TRUE; return EM_TRUE;
} }
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment