Game Development Stack Exchange is a question and answer site for professional and independent game developers. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

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

share|improve this question
Check documentation – XiaoChuan Yu Jun 13 '13 at 15:09

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);
share|improve this answer

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.