Audio Interface API
Note that the audio player is a generic audio player interface and is designed to support multiple audio formats besides MP3.
The Audio Interface (AI) manages disk navigation, audio navigation and audio control (see below). Thus, the user does not have to directly interface with the File System and audio control APIs. This greatly simplifies the software architecture.
The Audio Interface can be used in 2 different ways:
asynchronous” functions, which result/effect may not be produced in one single iteration. Using these functions usually leads to the use of state-machines in the user firmware (since one must wait for the completion of a command before launching a new one), and has the advantage of reducing the risks of audio underrun. Asynchronous functions always have the “ai_async” prefix. Note that only one asynchronous function can be used at a time.
synchronous” functions, which are executed immediately. This drastically simplifies the user firmware architecture (no use of state-machines since the synchronous AI functions are immediately executed) but *may* produce audio underrun since the execution time of these functions may be too long. Synchronous functions just have the “ai_” prefix.
All functions of the Audio Interface have a synchronous and asynchronous interface. For exam- ple, the command which returns the number of drives is:
async_nav_drive_nb() in the asynchronous interface.
Using asynchronous functions shall be the preferred solution in order to avoid audio underruns.
Audio Interface Architecture The AI commands to interface the audio player are divided into three categories:
Disk navigation (Disk Nav) Audio navigation (Audio Nav) Audio Control (Audio CTRL)
to browse into the tree architectures of the USB device. to manage a list of playable songs. to control the audio stream (play/pause/fast forward/...).