8
Gaming API and Sound
FileFormatNotSupportedException Constructors
The
FileFormatNotSupportedException
constructors:
•
public FileFormatNotSupportedException(
java.lang.Exception e) – The parameter
that caused the failure.
•
public FileFormatNotSupportedException(
java.lang.String info) – The parameter
information about the failure
•
public FileFormatNotSupportedException(
java.lang.String info, Exception e) – The parameters are
info
exception that caused the failure.
Java Gaming Sound API
BackgroundMusic class objects (from .mid resource file or from bytes array) can be
played by using GameScreen.playBackgroundMusic () method.
The following is a code sample to show implementation of the Java Gaming Sound API:
Java Gaming Sound API
import com.motorola.game.*;
public class GS extends GameScreen {
public BackgroundMusic bgm;
public GS()
{
bgm = BackgroundMusic.createBackgroundMusic("vinovata.mid");
playBackgroundMusic(bgm, true);
}
}
Max MIDI Extension Support
Max MIDI Extension Support is an extension of the Gaming API and allows Java
Applications the ability to read Max MIDI file types, specifically for the Karaoke
application.
a String containing information about the failure, and
class defines the following
is the underlying exception
e
is a String containing
info
- The underlying
e
61