Skip to content

Commit 32ee9d9

Browse files
Nikitha MohitheNikitha Mohithe
authored andcommitted
fix: added missing options to EmscriptenAudioWorkletNodeCreateOptions
1 parent 9bc3ffa commit 32ee9d9

File tree

2 files changed

+8
-0
lines changed

2 files changed

+8
-0
lines changed

src/lib/libwebaudio.js

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -318,6 +318,9 @@ var LibraryWebAudio = {
318318
numberOfInputs: {{{ makeGetValue('options', C_STRUCTS.EmscriptenAudioWorkletNodeCreateOptions.numberOfInputs, 'i32') }}},
319319
numberOfOutputs: optionsOutputs,
320320
outputChannelCount: readChannelCountArray({{{ makeGetValue('options', C_STRUCTS.EmscriptenAudioWorkletNodeCreateOptions.outputChannelCounts, 'i32*') }}}, optionsOutputs),
321+
channelCount: {{{ makeGetValue('options', C_STRUCTS.EmscriptenAudioWorkletNodeCreateOptions.channelCount, 'i32') }}},
322+
channelCountMode: {{{ makeGetValue('options', C_STRUCTS.EmscriptenAudioWorkletNodeCreateOptions.channelCountMode, 'i32') }}},
323+
channelInterpretation: {{{ makeGetValue('options', C_STRUCTS.EmscriptenAudioWorkletNodeCreateOptions.channelInterpretation, 'i32') }}},
321324
processorOptions: {
322325
callback,
323326
userData,

system/include/emscripten/webaudio.h

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -134,6 +134,11 @@ typedef struct EmscriptenAudioWorkletNodeCreateOptions
134134
int numberOfOutputs;
135135
// For each output, specifies the number of audio channels (1=mono/2=stereo/etc.) for that output. Default=an array of ones for each output channel.
136136
int *outputChannelCounts;
137+
// Extended options from AudioWorkletNode
138+
int channelCount;
139+
int channelCountMode;
140+
int channelInterpretation;
141+
137142
} EmscriptenAudioWorkletNodeCreateOptions;
138143

139144
// Instantiates the given AudioWorkletProcessor as an AudioWorkletNode, which continuously calls the specified processCallback() function on the browser's audio thread to perform audio processing.

0 commit comments

Comments
 (0)