Motorola C381P technical manual JSR 135 Mobile Media API

Models: C381P

1 130
Download 130 pages 15.6 Kb
Page 35
Image 35

9

JSR 135 Mobile Media API

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();

}

35

Page 35
Image 35
Motorola C381P technical manual JSR 135 Mobile Media API