()
| 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 }); |
no test coverage detected