|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Object | +--net.rim.device.api.system.Audio
Provides access to the device's audio system and speaker.
AudioListener| Field Summary | ||
|
static int |
AUDIO_CODEC_VOICENOTE
Voicenote coded (iDEN only) |
|
static int |
AUDIO_ERROR_BAD_DATA
Invalid data was provided |
|
static int |
AUDIO_ERROR_BAD_STATE
Playback is already in progress |
|
static int |
AUDIO_ERROR_FILESYSTEM_FULL
Filesystem is full |
|
static int |
AUDIO_ERROR_UNKNOWN
Unknown error |
|
static int |
AUDIO_OK
No error |
|
static int |
AUDIO_REQUEST_PENDING
Request pending |
| Method Summary | ||
|
static void |
addListener(Application app,
AudioListener listener)
Adds an audio listener to the specified application. |
|
static int |
getVolume()
Retrives the current audio volume. |
|
static boolean |
hasBuiltInHeadset()
Determines if the device has a built-in headset. |
|
static boolean |
isCodecSupported(int codec)
Determines if this device provides support for the specified codec. |
|
static boolean |
isHeadsetConnected()
Determines if the headset is currently connected. |
|
static boolean |
isSupported()
Determines if the device has audio support. |
|
static int |
playFile(int audioCodec,
int fs,
java.lang.String fileName)
Starts playing an audio file residing in the file system. |
|
static int |
recordFile(int audioCodec,
int fs,
java.lang.String fileName)
Starts recording an audio file residing in the file system. |
|
static void |
removeListener(Application app,
AudioListener listener)
Removes an audio listener from the specified application. |
|
static boolean |
setVolume(int volume)
Sets the desired audio volume. |
|
static int |
stopFile(int audioCodec,
int fs,
java.lang.String fileName)
Stops playing/recording an audio file residing in the file system. |
| Field Detail |
public static final int AUDIO_CODEC_VOICENOTE
public static final int AUDIO_OK
public static final int AUDIO_ERROR_UNKNOWN
public static final int AUDIO_ERROR_BAD_DATA
public static final int AUDIO_ERROR_BAD_STATE
public static final int AUDIO_ERROR_FILESYSTEM_FULL
public static final int AUDIO_REQUEST_PENDING
| Method Detail |
public static boolean isSupported()
public static int getVolume()
public static boolean setVolume(int volume)
volume - Percentage of maximum volume.public static boolean isHeadsetConnected()
public static boolean hasBuiltInHeadset()
public static boolean isCodecSupported(int codec)
public static int playFile(int audioCodec,
int fs,
java.lang.String fileName)
When the operation is complete, the
AudioFileListener.audioFileOperationComplete(int) method is invoked on the event thread.
If the operation fails, the
AudioFileListener.audioFileOperationFailed(int, int) method is invoked on the event thread.
audioCodec - One of the AUDIO_CODEC_ values.fs - One of the File.FILESYSTEM_ values.fileName - The name of the file to play from.AudioFileListener.audioFileOperationComplete(int),
AudioFileListener.audioFileOperationFailed(int, int)
public static int recordFile(int audioCodec,
int fs,
java.lang.String fileName)
If the operation fails, the
AudioFileListener.audioFileOperationFailed(int, int) method is invoked on the event thread.
audioCodec - One of the AUDIO_CODEC_ values.fs - One of the File.FILESYSTEM_ values.fileName - The name of the file to record to.AudioFileListener.audioFileOperationFailed(int, int)
public static int stopFile(int audioCodec,
int fs,
java.lang.String fileName)
When the operation is complete, the
AudioFileListener.audioFileOperationComplete(int) method is invoked on the event thread.
If the operation fails, the
AudioFileListener.audioFileOperationFailed(int, int) method is invoked on the event thread.
audioCodec - One of the AUDIO_CODEC_ values.fs - One of the File.FILESYSTEM_ values.fileName - The name of the file.AudioFileListener.audioFileOperationComplete(int),
AudioFileListener.audioFileOperationFailed(int, int)
public static void addListener(Application app,
AudioListener listener)
app - The application.listener - Audio listener to register.
public static void removeListener(Application app,
AudioListener listener)
app - The applicationlistener - Audio listener to de-register.
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
Copyright 1999-2005 Research In Motion Limited. 295 Phillip Street, Waterloo, Ontario, Canada, N2L 3W8. All Rights Reserved.
Copyright 1993-2000 Sun Microsystems, Inc. 901 San Antonio Road, Palo Alto, California, 94303, U.S.A. All Rights Reserved.
Java is a trademark or registered trademark of Sun Microsystems, Inc. in the US and other countries.