8
Gaming API and Sound
FileFormatNotSupportedException Constructors
The FileFormatNotSupportedException class defines the following constructors:
•public FileFormatNotSupportedException( java.lang.Exception e) – The parameter e is the underlying exception that caused the failure.
•public FileFormatNotSupportedException( java.lang.String info) – The parameter info is a String containing information about the failure
•public FileFormatNotSupportedException( java.lang.String info, Exception e) – The parameters are info a String containing information about the failure, and e - The underlying 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.
61