O'Reilly logo

Android NDK Beginner's Guide by Sylvain Ratabouil

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

Recording sounds

Android devices are all about interactions. And interactions can come not only from touches and sensors, but also from audio input. Most Android devices provide a micro to record sound and allow an application such as the Android desktop search to offer vocal features to record queries.

If sound input is available, OpenSL ES gives access to the sound recorder natively. It collaborates with a buffer queue to take data from the input device and fill an output sound buffer from it. Setup is pretty similar to what has been done with the AudioPlayer except that data source and data sink are permuted.

To discover how this works, next the challenge consists in recording a sound when an application starts and playing it when it has finished ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required