int Mp3Play(int sn);
Plays an MP3 file one time.
Return Value
Returns zero if successful.
Parameters
sn Handle to the MP3 file. Only one MP3 file may be played at a time. This is due to performance issues on the device. Calling this function while another Mp3 file is playing causes playback to stop, and the new file to play.
Remarks
Mp3Play() plays an MP3 file represented by an integer handle returned by Mp3Add().
Availability
Available in DragonFireSDK 1.1 and later.
Example
The example below loads a file called "Soundtrack.mp3" and calls Mp3Play() to play back the file. Mp3Stop() is called in AppExit() to halt playback.
#include "DragonFireSDK.h"
int Mp3Handle;
void AppMain() { Mp3Handle = Mp3Add("Soundtrack.mp3"); Mp3Play(Mp3Handle); }
void AppExit() { Mp3Stop(Mp3Handle); }
void OnTimer() {
} |