O'Reilly logo

Mastering Android NDK by Viktor Latypov, Sergey Kosarevsky

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

Chapter 5. Cross-platform Audio Streaming

In this chapter, we consider the last non-visual component needed to build interactive mobile applications. We are looking for a truly portable implementation of audio playback for Android and desktop PCs. We propose using the OpenAL library, since it is a well-established library on desktop platforms. Audio playback is inherently an asynchronous process, so the decoding and submitting of data to the sound API should be done on a separate thread. We will create an audio streaming library based on the multi-threading code from Chapter 3, Networking.

Raw uncompressed audio can take up a lot of memory, so compressed formats of different flavors are used quite often. We consider some of them in this chapter ...

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