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 applications. If you intend to use this element, please visit http://www.blackberry.com/go/codesigning to obtain a set of code signing keys. Code signing is only required for applications running on BlackBerry smartphones; development on BlackBerry Smartphone Simulators can occur without code signing.

Since:
JDE 4.0.2
See Also:
AudioListener

Field Summary
 Category: Signed static int AUDIO_CODEC_VOICENOTE
          Deprecated. No longer supported
 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 master 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 isRecordingCodecSupported(int codec)
          Determines if this device provides recording support for the specified codec.
 Category: Signed static boolean isSupported()
          Determines if the device has audio support.
 Category: Signed static int playFile(int audioCodec, int fs, String fileName)
          Deprecated. No longer supported
 Category: Signed static int recordFile(int audioCodec, int fs, String fileName)
          Deprecated. No longer supported
 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 master audio volume.
 Category: Signed static int stopFile(int audioCodec, int fs, String fileName)
          Deprecated. No longer supported
 
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
Deprecated. No longer supported

Voicenote codec (iDEN only)
Since:
JDE 4.0.2
Category:
Signed: This element is only accessible by signed applications. If you intend to use this element, please visit http://www.blackberry.com/go/codesigning to obtain a set of code signing keys. Code signing is only required for applications running on BlackBerry smartphones; development on BlackBerry Smartphone Simulators can occur without code signing.

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 applications. If you intend to use this element, please visit http://www.blackberry.com/go/codesigning to obtain a set of code signing keys. Code signing is only required for applications running on BlackBerry smartphones; development on BlackBerry Smartphone Simulators can occur without code signing.

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 applications. If you intend to use this element, please visit http://www.blackberry.com/go/codesigning to obtain a set of code signing keys. Code signing is only required for applications running on BlackBerry smartphones; development on BlackBerry Smartphone Simulators can occur without code signing.

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 applications. If you intend to use this element, please visit http://www.blackberry.com/go/codesigning to obtain a set of code signing keys. Code signing is only required for applications running on BlackBerry smartphones; development on BlackBerry Smartphone Simulators can occur without code signing.

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 applications. If you intend to use this element, please visit http://www.blackberry.com/go/codesigning to obtain a set of code signing keys. Code signing is only required for applications running on BlackBerry smartphones; development on BlackBerry Smartphone Simulators can occur without code signing.

AUDIO_OK

public static final int AUDIO_OK
No error
Since:
JDE 4.0.2
Category:
Signed: This element is only accessible by signed applications. If you intend to use this element, please visit http://www.blackberry.com/go/codesigning to obtain a set of code signing keys. Code signing is only required for applications running on BlackBerry smartphones; development on BlackBerry Smartphone Simulators can occur without code signing.

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 applications. If you intend to use this element, please visit http://www.blackberry.com/go/codesigning to obtain a set of code signing keys. Code signing is only required for applications running on BlackBerry smartphones; development on BlackBerry Smartphone Simulators can occur without code signing.
Method Detail

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 applications. If you intend to use this element, please visit http://www.blackberry.com/go/codesigning to obtain a set of code signing keys. Code signing is only required for applications running on BlackBerry smartphones; development on BlackBerry Smartphone Simulators can occur without code signing.

getVolume

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

Returns:
Percentage of maximum volume.
Since:
JDE 4.0.2
Category:
Signed: This element is only accessible by signed applications. If you intend to use this element, please visit http://www.blackberry.com/go/codesigning to obtain a set of code signing keys. Code signing is only required for applications running on BlackBerry smartphones; development on BlackBerry Smartphone Simulators can occur without code signing.

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 applications. If you intend to use this element, please visit http://www.blackberry.com/go/codesigning to obtain a set of code signing keys. Code signing is only required for applications running on BlackBerry smartphones; development on BlackBerry Smartphone Simulators can occur without code signing.

isCodecSupported

public static boolean isCodecSupported(int codec)
Determines if this device provides support for the specified codec.
Parameters:
codec - The codec to query.
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 applications. If you intend to use this element, please visit http://www.blackberry.com/go/codesigning to obtain a set of code signing keys. Code signing is only required for applications running on BlackBerry smartphones; development on BlackBerry Smartphone Simulators can occur without code signing.

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 applications. If you intend to use this element, please visit http://www.blackberry.com/go/codesigning to obtain a set of code signing keys. Code signing is only required for applications running on BlackBerry smartphones; development on BlackBerry Smartphone Simulators can occur without code signing.

isRecordingCodecSupported

public static boolean isRecordingCodecSupported(int codec)
Determines if this device provides recording support for the specified codec.
Parameters:
codec - The codec to query
Returns:
True if this device supports audio recording for the codec, false otherwise.
Since:
JDE 4.2.0
Category:
Signed: This element is only accessible by signed applications. If you intend to use this element, please visit http://www.blackberry.com/go/codesigning to obtain a set of code signing keys. Code signing is only required for applications running on BlackBerry smartphones; development on BlackBerry Smartphone Simulators can occur without code signing.

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 applications. If you intend to use this element, please visit http://www.blackberry.com/go/codesigning to obtain a set of code signing keys. Code signing is only required for applications running on BlackBerry smartphones; development on BlackBerry Smartphone Simulators can occur without code signing.

playFile

public static int playFile(int audioCodec,
                           int fs,
                           String fileName)
Deprecated. No longer supported

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.
Throws:
UnsupportedOperationException - If an unsupported file system is provided.
Since:
JDE 4.0.2
See Also:
AudioFileListener.audioFileOperationComplete(int), AudioFileListener.audioFileOperationFailed(int, int)
Category:
Signed: This element is only accessible by signed applications. If you intend to use this element, please visit http://www.blackberry.com/go/codesigning to obtain a set of code signing keys. Code signing is only required for applications running on BlackBerry smartphones; development on BlackBerry Smartphone Simulators can occur without code signing.

recordFile

public static int recordFile(int audioCodec,
                             int fs,
                             String fileName)
Deprecated. No longer supported

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.
Throws:
UnsupportedOperationException - If an unsupported file system is provided.
Since:
JDE 4.0.2
See Also:
AudioFileListener.audioFileOperationFailed(int, int)
Category:
Signed: This element is only accessible by signed applications. If you intend to use this element, please visit http://www.blackberry.com/go/codesigning to obtain a set of code signing keys. Code signing is only required for applications running on BlackBerry smartphones; development on BlackBerry Smartphone Simulators can occur without code signing.

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 applications. If you intend to use this element, please visit http://www.blackberry.com/go/codesigning to obtain a set of code signing keys. Code signing is only required for applications running on BlackBerry smartphones; development on BlackBerry Smartphone Simulators can occur without code signing.

setVolume

public static boolean setVolume(int volume)
Sets the desired master 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 applications. If you intend to use this element, please visit http://www.blackberry.com/go/codesigning to obtain a set of code signing keys. Code signing is only required for applications running on BlackBerry smartphones; development on BlackBerry Smartphone Simulators can occur without code signing.

stopFile

public static int stopFile(int audioCodec,
                           int fs,
                           String fileName)
Deprecated. No longer supported

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.
Throws:
UnsupportedOperationException - If an unsupported file system is provided.
Since:
JDE 4.0.2
See Also:
AudioFileListener.audioFileOperationComplete(int), AudioFileListener.audioFileOperationFailed(int, int)
Category:
Signed: This element is only accessible by signed applications. If you intend to use this element, please visit http://www.blackberry.com/go/codesigning to obtain a set of code signing keys. Code signing is only required for applications running on BlackBerry smartphones; development on BlackBerry Smartphone Simulators can occur without code signing.



Copyright 1999-2008 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.