AudioRecorder (code) interface. To create an instance of that interface use:

    1. AudioRecorder recorder = Gdx.audio.newAudioRecorder(22050, true);

    AudioRecorder with a sampling rate of 22.05khz, in mono mode. If the recorder couldn’t be created, a GdxRuntimeException will be thrown. Samples can be read as 16-bit signed PCM:

    1. short[] shortPCM = new short[1024]; // 1024 samplesrecorder.readSamples(shortPCM, 0, shortPCM.length);

    Stereo samples are interleaved as usual (first sample -> left channel, second sample -> right channel). AudioRecorder is a native resource and needs to be disposed of if no longer in use:

    1. recorder.dispose();

    Audio recording is not supported in the JavaScript/WebGL backend.