!7 set flag Android. set flag NoAWT. import android.media.*; import android.content.*; static int bufferSize = 8192; static int maxAudioQueueSize = 50; // raspi home, X20 static LS ips = ll("192.168.2.165", "192.168.43.244"); static AudioManager am; static AudioRecord recorder; static new L senders; static new L qSendAudio; static new Q qVoiceOut; static bool connected; p { androidSay_keepEngine = true; //set androidSay_keepEngine_verbose; set androidSay_keepEngine_inCall; for (S ip : ips) { print("Connecting to " + ip); new StefansOS_ConnectToServer sender; sender.server = ip; sender.onLine = voidfunc(S s) { final new Matches m; if (startsWith_trim(s, "voiceOutput:", m)) say(m.rest()); }; sender.tryToConnect = () -> !connectToServer_anyConnected(senders); sender.startWithSubs("voiceOutput"); senders.add(sender); qSendAudio.add(new Q); } doEvery(1.0,r { if (connectToServer_anyConnected(senders) != connected) { connected = !connected; say(connected ? "Connected" : "Lost connection"); } }); } svoid cleanMeUp { dispose senders; } svoid say(S s) { print("> " + s); addToQWithMaxSize_verbose(5, +qVoiceOut, r { androidSayInEnglish(s); }); }