beautypg.com

9jsr 135 mobile media api, Jsr 135 mobile media api – Motorola HANDSET C381P User Manual

Page 35

background image

9
JSR
135 Mobile Media API

35

9

JSR 135 Mobile Media API

JSR 135 Mobile Media API

The JSR 135 Mobile Media APIs feature sets are defined for five different types of media.
The media defined is as follows:

• Tone Sequence
• Sampled Audio
• MIDI

When a player is created for a particular type, it will follow the guidelines and control types
listed in the sections outlined below.

The Code Sample 4 shows the implementation of the JSR 135 Mobile Media API:

JSR 135

Player player;

// Create a media player, associate it with a stream
containing media data

try

{

player =
Manager.createPlayer(getClass().getResourceAsStream("MP3.mp3
"), "audio/mpeg");

}

catch (Exception e)

{

System.out.println("FAILED: exception for createPlayer:
" + e.toString());

}

// Obtain the information required to acquire the media
resources

try

{

player.realize();

}