!7 set flag Android. set flag AndroidOnly. set flag NoAWT. import android.media.*; static int bufferSize = 8192; // raspi home, X20 static LS ips = ll("192.168.2.165", "192.168.43.244"); static AudioRecord recorder; static new L senders; p { for (S ip : ips) { print("Connecting to " + ip); new StefansOS_ConnectToServer sender; sender.server = ip; sender.start(); senders.add(sender); } print("Making recorder"); recorder = new AudioRecord.Builder() .setAudioSource(MediaRecorder.AudioSource.VOICE_COMMUNICATION) .setAudioFormat(new AudioFormat.Builder() .setEncoding(AudioFormat.ENCODING_PCM_16BIT) .setSampleRate(16000) .setChannelMask(AudioFormat.CHANNEL_IN_MONO) .build()) .setBufferSizeInBytes(bufferSize) .build(); print("Made recorder"); recorder.startRecording(); print("Started recording"); byte[] buf = new[bufferSize]; while licensed { printWithTime("Read bytes: " + recorder.read(buf, 0, l(buf), AudioRecord.READ_BLOCKING); S line = "audio: " + base64(buf); for (StefansOS_ConnectToServer sender : senders) pcall { sender.sendLine(line); } } /*recorder.release(); print("Released recorder");*/ } svoid cleanMeUp { if (recorder != null) recorder.release(); dispose senders; }