Backgroundmusic Class; Backgroundmusic Methods; Using Backgroundmusic - Motorola C370 Series Technical Manual

J2me developer guide
Hide thumbs Also See for C370 Series:
Table of Contents

Advertisement

8
Gaming API and Sound

BackgroundMusic Class

The
BackgroundMusic
A game may create several
any one time. The sound data can be stored on the device as a named resource in the
application JAR file, or it can be stored on a server and retrieved via the network.
BackgroundMusic

BackgroundMusic Methods

The
BackgroundMusic
public static BackgroundMusic
createBackgroundMusic(java.lang.String name)
FileFormatNotSupportedException – Creates a BackgroundMusic for
the sound data stored in the specified named resource or URL. This method currently
supports the use of MIDI format 0 and format 1 only.

Using BackgroundMusic

The following code sample shows implementation of
Using BackgroundMusic
BackgroundMusic bgm1 = BackgroundMusic.createBackgroundMusic("/FunkyTunes.mid");
BackgroundMusic bgm2 =
BackgroundMusic.createBackgroundMusic("http://www.motorola.com/sounds/JazzyTunes.mid");
The following code sample shows implementation of the Gaming API that contains a
sound API:
Gaming API containing a sound API
import com.motorola.game.*;
public class GS extends GameScreen {
public BackgroundMusic bgm;
public GS()
{
bgm = BackgroundMusic.createBackgroundMusic("vinovata.mid");
playBackgroundMusic(bgm, true);
}
}
class encapsulates the data for a game's background music.
objects, but only one can be playing at
BackgroundMusic
is played by a
GameScreen
class defines the following methods:
.
throws
:
BackgroundMusic
39

Advertisement

Table of Contents
loading

This manual is also suitable for:

C450 seriesC550 series

Table of Contents