How do I...?

Play Background Music

Playing soft music in the background of your application can serve to set the mood desired for your application.

As an example, we will load background.ogg into the background audio channel of our project:

  1. Insert the following code into the On Show event of the first page in the project:

--loads background.ogg into the background channel, automatically plays, and loops
Audio.Load(CHANNEL_BACKGROUND, "AutoPlay\\Audio\\background.ogg", true, true);

Note: To play one song after another for your background music, please refer to Play multiple audio files in sequence.

An alternative way to add background music to your application is by using the Background Music tab on the Audio Settings dialog.  To access this dialog:

  1. Choose Project > Audio.

  2. Click the Add button

  3. Select your audio file

  1. Click OK

Note: Repeat steps 2 and 3 before clicking OK to add more than one audio file.