Skip to content

Latest commit

 

History

History
15 lines (12 loc) · 608 Bytes

README.md

File metadata and controls

15 lines (12 loc) · 608 Bytes

pcm-encoder

Simple PCM to MP4 encoder for Android

PCMEncoder provides simple API for concatenating multiple PCM streams into one, encoded MP4 file on Android devices. It uses MediaMuxer, MediaCodec and MediaFormat, which are available since Android API 18.

Usage:

PCMEncoder pcmEncoder = new PCMEncoder(outputFileBitrate, outputFileSampleRate, outputFileNumberOfChannels);
pcmEncoder.setOutputPath(outputPath);
pcmEncoder.prepare();
pcmEncoder.encode(inputStream, inputStreamSampleRate);
pcmEncoder.stop();

The encode method can be called multiple times (see MainActivity for more details).