SHOW Signed

net.rim.device.api.system
Class Audio

java.lang.Object
  |
  +--net.rim.device.api.system.Audio

public final class Audio
extends Object

Provides access to the device's audio system and speaker.

Category:
Signed: This element is only accessible by signed clients. If you intend to use this element, please contact RIM to establish the necessary agreements that will allow you to have your COD files signed. Signing is only required for use on the device, development under the JDE can occur without signing the CODs.

Since:
JDE 4.0.2
See Also:
AudioListener

Field Summary
 Category: Signed static int AUDIO_CODEC_VOICENOTE
          Voicenote coded (iDEN only)
 Category: Signed static int AUDIO_ERROR_BAD_DATA
          Invalid data was provided
 Category: Signed static int AUDIO_ERROR_BAD_STATE
          Playback is already in progress
 Category: Signed static int AUDIO_ERROR_FILESYSTEM_FULL
          Filesystem is full
 Category: Signed static int AUDIO_ERROR_UNKNOWN
          Unknown error
 Category: Signed static int AUDIO_OK
          No error
 Category: Signed static int AUDIO_REQUEST_PENDING
          Request pending
 
Method Summary
 Category: Signed static void addListener(Application app, AudioListener listener)
          Adds an audio listener to the specified application.
 Category: Signed static int getVolume()
          Retrives the current audio volume.
 Category: Signed static boolean hasBuiltInHeadset()
          Determines if the device has a built-in headset.
 Category: Signed static boolean isCodecSupported(int codec)
          Determines if this device provides support for the specified codec.
 Category: Signed static boolean isHeadsetConnected()
          Determines if the headset is currently connected.
 Category: Signed static boolean isSupported()
          Determines if the device has audio support.
 Category: Signed static int playFile(int audioCodec, int fs, String fileName)
          Starts playing an audio file residing in the file system.
 Category: Signed static int recordFile(int audioCodec, int fs, String fileName)
          Starts recording an audio file residing in the file system.
 Category: Signed static void removeListener(Application app, AudioListener listener)
          Removes an audio listener from the specified application.
 Category: Signed static boolean setVolume(int volume)
          Sets the desired audio volume.
 Category: Signed static int stopFile(int audioCodec, int fs, String fileName)
          Stops playing/recording an audio file residing in the file system.
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail


AUDIO_CODEC_VOICENOTE

public static final int AUDIO_CODEC_VOICENOTE
Voicenote coded (iDEN only)
Since:
JDE 4.0.2
Category:
Signed: This element is only accessible by signed clients. If you intend to use this element, please contact RIM to establish the necessary agreements that will allow you to have your COD files signed. Signing is only required for use on the device, development under the JDE can occur without signing the CODs.

AUDIO_OK

public static final int AUDIO_OK
No error
Since:
JDE 4.0.2
Category:
Signed: This element is only accessible by signed clients. If you intend to use this element, please contact RIM to establish the necessary agreements that will allow you to have your COD files signed. Signing is only required for use on the device, development under the JDE can occur without signing the CODs.

AUDIO_ERROR_UNKNOWN

public static final int AUDIO_ERROR_UNKNOWN
Unknown error
Since:
JDE 4.0.2
Category:
Signed: This element is only accessible by signed clients. If you intend to use this element, please contact RIM to establish the necessary agreements that will allow you to have your COD files signed. Signing is only required for use on the device, development under the JDE can occur without signing the CODs.

AUDIO_ERROR_BAD_DATA

public static final int AUDIO_ERROR_BAD_DATA
Invalid data was provided
Since:
JDE 4.0.2
Category:
Signed: This element is only accessible by signed clients. If you intend to use this element, please contact RIM to establish the necessary agreements that will allow you to have your COD files signed. Signing is only required for use on the device, development under the JDE can occur without signing the CODs.

AUDIO_ERROR_BAD_STATE

public static final int AUDIO_ERROR_BAD_STATE
Playback is already in progress
Since:
JDE 4.0.2
Category:
Signed: This element is only accessible by signed clients. If you intend to use this element, please contact RIM to establish the necessary agreements that will allow you to have your COD files signed. Signing is only required for use on the device, development under the JDE can occur without signing the CODs.

AUDIO_ERROR_FILESYSTEM_FULL

public static final int AUDIO_ERROR_FILESYSTEM_FULL
Filesystem is full
Since:
JDE 4.0.2
Category:
Signed: This element is only accessible by signed clients. If you intend to use this element, please contact RIM to establish the necessary agreements that will allow you to have your COD files signed. Signing is only required for use on the device, development under the JDE can occur without signing the CODs.

AUDIO_REQUEST_PENDING

public static final int AUDIO_REQUEST_PENDING
Request pending
Since:
JDE 4.0.2
Category:
Signed: This element is only accessible by signed clients. If you intend to use this element, please contact RIM to establish the necessary agreements that will allow you to have your COD files signed. Signing is only required for use on the device, development under the JDE can occur without signing the CODs.
Method Detail

isSupported

public static boolean isSupported()
Determines if the device has audio support.
Returns:
true if the device has audio support.
Since:
JDE 4.0.2
Category:
Signed: This element is only accessible by signed clients. If you intend to use this element, please contact RIM to establish the necessary agreements that will allow you to have your COD files signed. Signing is only required for use on the device, development under the JDE can occur without signing the CODs.

getVolume

public static int getVolume()
Retrives the current audio volume.

Returns:
Percentage of maximum volume.
Since:
JDE 4.0.2
Category:
Signed: This element is only accessible by signed clients. If you intend to use this element, please contact RIM to establish the necessary agreements that will allow you to have your COD files signed. Signing is only required for use on the device, development under the JDE can occur without signing the CODs.

setVolume

public static boolean setVolume(int volume)
Sets the desired audio volume.

Parameters:
volume - Percentage of maximum volume.
Returns:
False if an error occurred.
Since:
JDE 4.0.2
Category:
Signed: This element is only accessible by signed clients. If you intend to use this element, please contact RIM to establish the necessary agreements that will allow you to have your COD files signed. Signing is only required for use on the device, development under the JDE can occur without signing the CODs.

isHeadsetConnected

public static boolean isHeadsetConnected()
Determines if the headset is currently connected.

Returns:
True if the headset is currently connected. Note on some platforms the audio channel must be turned on in order for the device to detect the headset.
Since:
JDE 4.0.2
Category:
Signed: This element is only accessible by signed clients. If you intend to use this element, please contact RIM to establish the necessary agreements that will allow you to have your COD files signed. Signing is only required for use on the device, development under the JDE can occur without signing the CODs.

hasBuiltInHeadset

public static boolean hasBuiltInHeadset()
Determines if the device has a built-in headset.

Returns:
True if the device has a built-in headset.
Since:
JDE 4.0.2
Category:
Signed: This element is only accessible by signed clients. If you intend to use this element, please contact RIM to establish the necessary agreements that will allow you to have your COD files signed. Signing is only required for use on the device, development under the JDE can occur without signing the CODs.

isCodecSupported

public static boolean isCodecSupported(int codec)
Determines if this device provides support for the specified codec.
Returns:
True if this device provides support for the specified codec; otherwise, false.
Since:
JDE 4.0.2
Category:
Signed: This element is only accessible by signed clients. If you intend to use this element, please contact RIM to establish the necessary agreements that will allow you to have your COD files signed. Signing is only required for use on the device, development under the JDE can occur without signing the CODs.

playFile

public static int playFile(int audioCodec,
                           int fs,
                           String fileName)
Starts playing an audio file residing in the file system.

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.

Parameters:
audioCodec - One of the AUDIO_CODEC_ values.
fs - One of the File.FILESYSTEM_ values.
fileName - The name of the file to play from.
Returns:
One of the AUDIO_* values.
Since:
JDE 4.0.2
See Also:
AudioFileListener.audioFileOperationComplete(int), AudioFileListener.audioFileOperationFailed(int, int)
Category:
Signed: This element is only accessible by signed clients. If you intend to use this element, please contact RIM to establish the necessary agreements that will allow you to have your COD files signed. Signing is only required for use on the device, development under the JDE can occur without signing the CODs.

recordFile

public static int recordFile(int audioCodec,
                             int fs,
                             String fileName)
Starts recording an audio file residing in the file system.

If the operation fails, the AudioFileListener.audioFileOperationFailed(int, int) method is invoked on the event thread.

Parameters:
audioCodec - One of the AUDIO_CODEC_ values.
fs - One of the File.FILESYSTEM_ values.
fileName - The name of the file to record to.
Returns:
One of the AUDIO_* values.
Since:
JDE 4.0.2
See Also:
AudioFileListener.audioFileOperationFailed(int, int)
Category:
Signed: This element is only accessible by signed clients. If you intend to use this element, please contact RIM to establish the necessary agreements that will allow you to have your COD files signed. Signing is only required for use on the device, development under the JDE can occur without signing the CODs.

stopFile

public static int stopFile(int audioCodec,
                           int fs,
                           String fileName)
Stops playing/recording an audio file residing in the file system.

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.

Parameters:
audioCodec - One of the AUDIO_CODEC_ values.
fs - One of the File.FILESYSTEM_ values.
fileName - The name of the file.
Returns:
One of the AUDIO_* values.
Since:
JDE 4.0.2
See Also:
AudioFileListener.audioFileOperationComplete(int), AudioFileListener.audioFileOperationFailed(int, int)
Category:
Signed: This element is only accessible by signed clients. If you intend to use this element, please contact RIM to establish the necessary agreements that will allow you to have your COD files signed. Signing is only required for use on the device, development under the JDE can occur without signing the CODs.

addListener

public static void addListener(Application app,
                               AudioListener listener)
Adds an audio listener to the specified application.
Parameters:
app - The application.
listener - Audio listener to register.
Since:
JDE 4.0.2
Category:
Signed: This element is only accessible by signed clients. If you intend to use this element, please contact RIM to establish the necessary agreements that will allow you to have your COD files signed. Signing is only required for use on the device, development under the JDE can occur without signing the CODs.

removeListener

public static void removeListener(Application app,
                                  AudioListener listener)
Removes an audio listener from the specified application.
Parameters:
app - The application
listener - Audio listener to de-register.
Since:
JDE 4.0.2
Category:
Signed: This element is only accessible by signed clients. If you intend to use this element, please contact RIM to establish the necessary agreements that will allow you to have your COD files signed. Signing is only required for use on the device, development under the JDE can occur without signing the CODs.


Copyright 1999-2004 Research In Motion Limited. 295 Phillip Street, Waterloo, Ontario, Canada, N2L 3W8. All Rights Reserved.
Copyright 1993-2003 Sun Microsystems, Inc. 901 San Antonio Road, Palo Alto, California, 94303, U.S.A.
Copyright 2002-2003 Nokia Corporation All Rights Reserved.
Java is a trademark or registered trademark of Sun Microsystems, Inc. in the US and other countries.