Android Native Play Sound using /dev/msm_pcm_out
By Radu Motisan Posted on November 18th, 2010 , 3689 Views (Rate 3.31)
Following my previous article, where I presented that it is possible to write a native C application to directly extract the screen's framebuffer data and save it as a BMP, for the purpose of making screen captures, I will give another example of using the NDK to compile a C code that would play sounds on your Android, by directly interfacing the PCM device: /dev/msm_pcm_out
Simply copy the binary to your Android, and play a wave file by calling:
./playsound -play learn.wav
Easy, and a nice surprise to hear sounds coming from your Android, without having any top level interfaces running for that purpose.
The project files: