Recording and playing back sounds with LibGDX

| | August 18, 2015

How do I record a sound to PCM format and replay it from there?

One Response to “Recording and playing back sounds with LibGDX”

  1. to record:

    AudioRecorder recorder =, isMono);
    short[] pCM = new float[1024]; // 1024 samples
    recorder.readSamples(pCM, 0, pCM.length);

    to play back:

    AudioDevice device =, isMono);
    device.writeSamples(pCM, 0, pCM.length);

Leave a Reply