|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectde.enough.polish.multimedia.AudioPlayer
public class AudioPlayer
Plays back audio files - at the moment this is only supported for MIDP 2.0 and devices that support the MMAPI
Copyright Enough Software 2006 - 2008
history
Nov 21, 2006 - rob creation
| Field Summary |
|---|
| Fields inherited from interface javax.microedition.media.PlayerListener |
|---|
CLOSED, DEVICE_AVAILABLE, DEVICE_UNAVAILABLE, DURATION_UPDATED, END_OF_MEDIA, ERROR, STARTED, STOPPED, VOLUME_CHANGED |
| Constructor Summary | |
|---|---|
AudioPlayer()
Creates a new audio player with no default content type and no caching. |
|
AudioPlayer(boolean doCachePlayer)
Creates a new audio player with no default content type. |
|
AudioPlayer(boolean doCachePlayer,
java.lang.String contentType)
Creates a new audio player with no listener |
|
AudioPlayer(boolean doCachePlayer,
java.lang.String contentType,
javax.microedition.media.PlayerListener listener)
Creates a new audio player |
|
AudioPlayer(java.lang.String contentType)
Creates a new audio player without caching and with no listener. |
|
| Method Summary | |
|---|---|
void |
cleanUpPlayer()
Closes and deallocates the player. |
static java.lang.String |
getAudioType(java.lang.String type,
java.lang.String protocol)
Helper function for getting a supported media type. |
javax.microedition.media.Player |
getPlayer()
Returns the original player. |
boolean |
isPlaying()
Determines if the audio player is currently playing music |
void |
play()
Plays back the last media again. |
void |
play(java.io.InputStream in)
Plays the media taken from the specified input stream with the content type specified in the constructor. |
void |
play(java.io.InputStream in,
java.lang.String type)
Plays the media taken from the specified input stream. |
void |
play(java.lang.String url)
Plays the media taken from the specified URL with the content type specified in the constructor. |
void |
play(java.lang.String url,
java.lang.String type)
Plays the media taken from the specified URL. |
void |
playerUpdate(javax.microedition.media.Player p,
java.lang.String event,
java.lang.Object data)
|
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
|---|
public AudioPlayer()
public AudioPlayer(boolean doCachePlayer)
doCachePlayer - caches the player even though the end of the media is reachedpublic AudioPlayer(java.lang.String contentType)
contentType - the type of the referenced media, this is being resolved to the phone's expected type automatically.
You can, for example, use the type "audio/mp3" and this method resolves the type to "audio/mpeg3", if this
is expected by the device.
public AudioPlayer(boolean doCachePlayer,
java.lang.String contentType)
doCachePlayer - caches the player even though the end of the media is reachedcontentType - the type of the referenced media, this is being resolved to the phone's expected type automatically.
You can, for example, use the type "audio/mp3" and this method resolves the type to "audio/mpeg3", if this
is expected by the device.
public AudioPlayer(boolean doCachePlayer,
java.lang.String contentType,
javax.microedition.media.PlayerListener listener)
doCachePlayer - caches the player even though the end of the media is reachedcontentType - the type of the referenced media, this is being resolved to the phone's expected type automatically.
You can, for example, use the type "audio/mp3" and this method resolves the type to "audio/mpeg3", if this
is expected by the device.listener - an optional PlayerListener| Method Detail |
|---|
public void play(java.lang.String url,
java.lang.String type)
throws javax.microedition.media.MediaException,
java.io.IOException
url - the URL of the mediatype - the type of the referenced media, this is being resolved to the phone's expected type automatically.
You can, for example, use the type "audio/mp3" and this method resolves the type to "audio/mpeg3", if this
is expected by the device.
javax.microedition.media.MediaException - when the media is not supported
java.io.IOException - when the URL cannot be resolved
public void play(java.io.InputStream in,
java.lang.String type)
throws javax.microedition.media.MediaException,
java.io.IOException
in - the media inputtype - the type of the referenced media, this is being resolved to the phone's expected type automatically.
You can, for example, use the type "audio/mp3" and this method resolves the type to "audio/mpeg3", if this
is expected by the device.
javax.microedition.media.MediaException - when the media is not supported
java.io.IOException - when the input cannot be read
public void play(java.lang.String url)
throws javax.microedition.media.MediaException,
java.io.IOException
url - the URL of the media
javax.microedition.media.MediaException - when the media is not supported
java.io.IOException - when the URL cannot be resolved
public void play(java.io.InputStream in)
throws javax.microedition.media.MediaException,
java.io.IOException
in - the media input
javax.microedition.media.MediaException - when the media is not supported
java.io.IOException - when the input cannot be read
public void play()
throws javax.microedition.media.MediaException
javax.microedition.media.MediaException - when the player cannot be startedAudioPlayer(boolean),
AudioPlayer(boolean, String),
AudioPlayer(boolean, String, PlayerListener),
AudioPlayer(String)public javax.microedition.media.Player getPlayer()
public static java.lang.String getAudioType(java.lang.String type,
java.lang.String protocol)
type - the type like "audio/mp3"protocol - the protocol, when null is given the content type will be
returned for any protocol
public boolean isPlaying()
public void playerUpdate(javax.microedition.media.Player p,
java.lang.String event,
java.lang.Object data)
playerUpdate in interface javax.microedition.media.PlayerListenerpublic void cleanUpPlayer()
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||