int Mp3Add(char *filename);

 

Loads an MP3 file for playback.

 

Return Value

 

Returns in handle to the file loaded.

 

Parameters

 

filename

File name of the MP3 to add.  Only one MP3 file may be played at a time.  This is due to performance issues on the device.

 

The path to the file named in this parameter must be in the Assets folder where your application resides.  (Typically, your project's Debug or Release folder.  For example, if your project is in C:\DragonFireSDK\, your Assets folder will be C:\DragonFireSDK\Debug\Assets or C:\DragonFireSDK\Release\Assets.)

 

You may also specify an MP3 file that is in your application's Documents folder by adding "Documents/" in front of the rest of the path.  This is especially useful if your application uses NetSend() to download new MP3's.

 

NOTE: The file system used by iOS is case sensitive, so be sure to match the case of the file name in your code to that of the file on your computer.

 

Remarks

 

Mp3Add() loads an MP3 file and returns an integer handle that can be used by Mp3Play() and Mp3Loop().

 

Availability

 

Available in DragonFireSDK 1.1 and later.

 

Example

 

The example below loads a file called "Soundtrack.mp3" and calls Mp3Loop() to play back the file indefinitely. Mp3Stop() is called in AppExit() to halt playback.

 

#include "DragonFireSDK.h"

 

int Mp3Handle;

 

void AppMain()

{

  Mp3Handle = Mp3Add("Soundtrack.mp3");

  Mp3Loop(Mp3Handle);

}

 

void AppExit()

{

  Mp3Stop(Mp3Handle);

}

 

void OnTimer()

{

 

}