Skip to content

Commit 10c1608

Browse files
committed
Start the node
1 parent 0110d97 commit 10c1608

1 file changed

Lines changed: 11 additions & 0 deletions

File tree

src/hostapi/webaudio/pa_webaudio.c

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -175,6 +175,11 @@ EM_JS(void, Js_Initialize, (), {
175175
return node;
176176
},
177177

178+
startNode: function(id) {
179+
const node = this.getNode(id);
180+
node.start();
181+
},
182+
178183
connectNodeToDestination: function(id) {
179184
const node = this.getNode(id);
180185
const context = node.context;
@@ -209,6 +214,10 @@ EM_JS(int, Js_CreateScriptProcessorNode, (int contextId, int bufferSize, int out
209214
return globalThis.__portaudio.createScriptProcessorNode(contextId, bufferSize, outputChannels);
210215
});
211216

217+
EM_JS(void, Js_StartNode, (int id), {
218+
globalThis.__portaudio.startNode(id);
219+
});
220+
212221
EM_JS(void, Js_ConnectNodeToDestination, (int id), {
213222
globalThis.__portaudio.connectNodeToDestination(id);
214223
});
@@ -763,7 +772,9 @@ static PaError StartStream( PaStream *s )
763772
PaWebAudioStream *stream = (PaWebAudioStream*)s;
764773

765774
PaUtil_ResetBufferProcessor( &stream->bufferProcessor );
775+
766776
Js_ConnectNodeToDestination(stream->nodeId);
777+
Js_StartNode(stream->nodeId);
767778

768779
stream->isActive = 1;
769780

0 commit comments

Comments
 (0)