Audio sample widget
Our Widget Samples series continues with the Audio sample widget, which demonstrates just how easy it is to add sound capabilities to your JIL apps and games. Whether you want to create a dedicated audio player, or add sound effects to a game or app, the JIL/WAC audio API is simple and easy to use, and supports play, pause, resume, stop, and repeat play, for local and remote files.
Common audio formats are supported including MP3, for high quality audio playback, and WAV (useful for samples and effects). Depending on the phone, MP4 (i.e. AAC/M4A) and Ogg Vorbis may also be supported.
The Audio sample widget is a simple, but complete, example of an MP3 player application that uses the JIL/WAC audio APIs to play tracks from a playlist. You can reuse the sample code as a starting point for your own projects.
The screen shot below shows the Audio sample widget running on the HTC Desire:
Read the Code Notes
Like all samples in the series we're also publishing detailed Code Notes which walk through the source files in detail.
You can download the sample and find the Code Notes here.
What's in the download
The download includes:
- The installable widget package (unsigned)
- Fully commented source code
- README.txt
The widget is compatible with the latest Android phones on Vodafone, as well as the Nokia N8.