crucialfelix / supercolliderjs

The JavaScript client library for SuperCollider
https://crucialfelix.github.io/supercolliderjs/
MIT License
478 stars 43 forks source link

Detect scsynth exit after boot and propagate an error #22

Open crucialfelix opened 8 years ago

crucialfelix commented 8 years ago

Initial boot of sclang does produce a PID, but it quits a moment later with:

 info: stdout : input and output sample rates do not match. 48000 != 44100
[1]            could not initialize audio.

Dryadic scsynth does not respond or notify about this event.

Note also that scsynth posts error messages to stdout, not stderr

crucialfelix commented 7 years ago

You can attach an event handler manually like this:

function fail(result) {
  console.error(result);
  console.trace();
  process.exit(1);
}

server.on('exit', fail);