MCPcopy Create free account
hub / github.com/csound/csound / handleStart

Method handleStart

wasm/nodejs/src/singlethread.js:93–113  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

91 }
92
93 handleStart() {
94 const shouldDemonize = this.libcsound.csoundShouldDaemonize(this.csoundInstance) === 1;
95
96 if (shouldDemonize) {
97 this.libcsound.csoundSetOption(this.csoundInstance, "--daemon");
98 this.libcsound.csoundSetOption(this.csoundInstance, "-odac");
99 }
100
101 const startError = this.wasm.exports.csoundStartWasi(this.csoundInstance);
102 const outputName = this.libcsound.csoundGetOutputName(this.csoundInstance) || "test.wav";
103 const isExpectingRealtimeOutput = shouldDemonize || outputName.includes("dac");
104
105 if (startError !== 0) {
106 console.error(`error: start failed look out syntax or configuration errors`);
107 return;
108 }
109
110 if (isExpectingRealtimeOutput) {
111 this.processRealtimeAudio();
112 }
113 }
114
115 async initialize({ withPlugins = [] }) {
116 this.wasm = await loadWasm({ withPlugins });

Callers 1

csoundStartMethod · 0.95

Calls 2

processRealtimeAudioMethod · 0.95
errorMethod · 0.80

Tested by

no test coverage detected