Citizendia
Your Ad Here

The Mobile Media API (MMAPI) is an API specification for the Java ME platform CDC and CLDC devices such as mobile phones. In computing the Java Platform Micro Edition or Java ME (still commonly referred to by its previous name Java 2 Platform Micro Edition or J2ME) is a specification The Connected Device Configuration ( CDC) is a framework for building Java ME applications on embedded devices ranging from Pagers up to Set-top boxes The Connected Limited Device Configuration ( CLDC) is a specification of a Framework for Java ME applications targeted at devices with very limited resources Depending on how it's implemented, the APIs allow applications to play and record sounds and video, and to capture still images. MMAPI was developed under the Java Community Process as JSR 135. The Java Community Process or JCP, established in 1998, is a formalized process which allows interested parties to be involved in the definition of future versions

Contents

Programming concepts

The Multimedia Java API is based around four main types of classes in the javax. microedition. media package—the Manager, the Player, the PlayerListener and various types of Control. A Java package is a mechanism for organizing Java classes into namespaces similar to the modules of Modula.

Java ME programmers wishing to use JSR 135 would first make use of the static methods of the Manager class. In Object-oriented programming, a class is a Programming language construct that is used as a blueprint to create objects This blueprint includes attributes Although there are other methods such as playTone, the main method used is createPlayer. This takes either a URI or an InputStream, and optionally a MIME type. An Internet media type, originally called a MIME type after MIME and sometimes a Content-type after the name of a header in several protocols whose value In most cases, URIs are used. Common URI protocols used include:

The MIME type is optional, and is inferred from the data passed in if not supplied.

The createPlayer method returns an implementation of the Player interface (even if you use a capture: protocol URI). An interface in the Java programming language is an Abstract type that is used to specify an interface (in the generic sense of the term that classes This has core methods that are applicable to all players, such as starting and stopping the media, and requesting that it loop. You can also setPlayerListener to an object implementing the PlayerListener interface, which will receive various events related to the clip (starting, stopping, media finishing, etc. )

Player classes also have a getControl method that returns an implementation of a particular Control. A Control handles any optional APIs which are not applicable to all media types. Any given Player may or may not be able to supply an implementation of any given Control.

(Typically, the Control returned is actually the Player itself, but this is not guaranteed to be the case. )

The set of controls implemented by a Player is not limited; however, some standard ones are defined in the javax. microedition. media. control package by the JSR:

RateControl for setting the speed of a clip
MetaDataControl for accessing metadata about a clip, for example ID3 tags
FramePositioningControl for setting a video clip location based on frames rather than time
StopTimeControl for asking a clip to stop at a given time
RecordControl to specify how you wish to record using a capture: URI, and for taking snapshots
ToneControl for note-based formats such as MIDI, specifying the tone
PitchControl for note-based formats, specifying the pitch
MIDIControl for MIDI-specific functions such as bank queries
VideoControl for specifying where on the screen video might play

(Others may be defined in JSR 234 (Advanced Multimedia Supplements). ID3 is a Metadata container most often used in conjunction with the MP3 Audio file format. MIDI ( Musical Instrument Digital Interface, ˈmɪdi is an industry-standard protocol that enables Electronic musical instruments Computers In computing the Advanced Multimedia Supplements (also JSR-234 or AMMS) is an API specification for the Java ME platform

A subset of JSR 135 is defined in JSR 118 (MIDP 2. Mobile Information Device Profile ( MIDP) is a specification published for the use of Java on Embedded devices such as Mobile phones and PDAs 0).

Implementations

As with most Java ME specifications, implementations differ despite the best efforts of the specification authors to ensure consistency. Two obvious areas for differences are in the controls supported, and in the acceptable URI types in the first place. More obscure areas are whether mixing is supported; many games would like to play a MIDI music track and layer PCM sound effects on top. MIX is a hypothetical computer used in Donald Knuth &rsquos monograph The Art of Computer Programming ( TAOCP)

Another source of extreme variance is in performance. For example, if an HTTP clip is requested, at what point does the clip get downloaded? The specification recognises this by providing two Player methods that can be called in advance of actually playing: realize and prefetch. Hypertext Transfer Protocol ( HTTP) is a Communications protocol for the transfer of information on the Internet. Depending on the implementation, these may do some of the work of getting the clip into a playable state, thus making it quicker to actually play the clip when it is needed. Some implementations are sophisticated enough to actually stream a clip on request whilst it is being played.

Symbian OS contains a very complete implementation of JSR 135, but even this is highly dependent on the underlying multimedia capabilities of the device, and some device manufacturers may choose not to expose the more obscure parts of Java ME such as recording. Symbian OS is an open Operating system, designed for Mobile devices with associated libraries, User interface frameworks and

Implementation consistency is ensured by forcing all implementations to pass the Java Technology Compatibility Kit (TCK). A Technology Compatibility Kit (TCK is a suite of tests that at least nominally checks a particular alleged implementation of a Java Specification Request ( JSR) for This ensures that each supported URI schema, MIME type and Control is tested, but does not test every permutation of these optional parts.

Code example

import javax. microedition. media. *;

Player p = Manager. createPlayer("http://www.fishy.com/my.mp3");
p. start();

External links


© 2009 citizendia.org; parts available under the terms of GNU Free Documentation License, from http://en.wikipedia.org
Dapyx Software network: MP3 Explorer | Ebook Manager | Zenithic