Java Reference
In-Depth Information
In the ABB, a Player knows how to render audio data with a particular content type, while
an associated data source handles transporting the data to the Player . In the Mobile Media API,
the abstract DataSource class represents data sources. In the MIDP 2.0 ABB, data sources are
not explicitly available, but implicitly associated with a Player . The path of the audio informa-
tion is illustrated in Figure 16-2.
Figure 16-2. Audio data path
Manager doles out Player s for content types and protocols requested via its createPlayer()
methods. One or more controls may be associated with a Player to specify playback parameters
like volume. In the ABB, javax.microedition.media.Control is an interface representing a control,
while the javax.microedition.media.control package contains more specific subinterfaces.
The relationship between the classes is shown in Figure 16-3.
Figure 16-3. Class relationships
Supported Content Types and Protocols
One of the least understood aspects of the ABB is its supported content types. MIDP 2.0 is very
flexible about the content types and protocols an implementation may support. All the specifi-
cation says is that if sampled audio is supported at all, then 8-bit PCM WAV must be supported.
Beyond that, the sky's the limit.
If you do ask Manager for data or a protocol that it can't handle, a MediaException will
be thrown.
You can find out, at runtime, what content types and protocols are supported using two
methods in the Manager class:
public static String [] getSupportedContentTypes(String protocol)
public static String [] getSupportedProtocols(String content_type)
You can find out the content types for a given protocol, or the protocols for a given content.
If you supply null to either of these methods, you'll get a complete list of supported content
types or protocols.
Search WWH ::




Custom Search