No audio input when using sclang command line

I’m using sclang embedded in my own software, but cannot get any audio input to the server. I am running a simple echo to test:

~synth0=SynthDef("SD0", {, 2))} ).play;

Audio output works fine, as does audio input using the SC IDE. I can see all my devices via


Any ideas anyone?

Are you taking input from a mic? You need to use SoundIn:

~synth0=SynthDef("SD0", {,} ).play;

Yes, I’ve tried SoundIn too, but no joy. What I don’t understand is that it works fine in the IDE, just not when I run sclang from the command line.

but you can make sound?

~synth0=SynthDef("SD0", {,, 0, 0.1))} ).play;

yes, audio output works fine