0

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.

gop
  • 2,150
  • 5
  • 26
  • 54

1 Answers1

3

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.

omikes
  • 8,064
  • 8
  • 37
  • 50
jassuncao
  • 4,695
  • 3
  • 30
  • 35