Question

I have 16 bit PCM audio and I want to convert it to 8bit PCMU. As far as I know 16bit to 8 bit conversion is easy - just drop the last 8 bits from each sample.

I want to know how to convert 8 bit pcm to 8 bit pcmu? Any article or sample code will be great!

This is for a mobile platform where no ready-to-use frameworks are available so I will need to do that with custom implementation.

Was it helpful?

Solution

Check the wikipedia article regarding the μ-law algorithm .

At the bottom it mentions this article where the author shows how to compress 16 samples to 8 bit PCMU samples in C code. Porting that code to Java is trivial.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top