|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectdanger.audio.AudioManager
public class AudioManager
| Constructor Summary | |
|---|---|
AudioManager()
|
|
| Method Summary | |
|---|---|
static boolean |
canCreateRecorder()
If a Recorder can be created with createRecorder(), this will return true, otherwise false |
static Recorder |
createRecorder()
Create a new sound Recorder object. |
static Sequence |
createSequence()
Create a new Sequence object. |
static Sequence |
createSequence(boolean autoDelete)
Create a new Sequence object. |
static Sequence |
createSequence(boolean autoDelete,
int type)
Create a new Sequence object. |
static Sound |
createSound()
Create a new Sound object. |
static Sound |
createSound(boolean autoDelete)
Create a new Sound object. |
static Sound |
createSound(boolean autoDelete,
int type)
Create a new Sound object. |
static Stream |
createStream()
Create a new Stream object. |
static Stream |
createStream(boolean autoDelete)
Create a new Stream object. |
static Stream |
createStream(boolean autoDelete,
int type)
Create a new Stream object. |
static void |
eventAudio(Event event)
|
static String |
getCodecMimeType(int fileType)
Return MIME type from passed in Format.Type.* which can be obtained from isCodecSupported |
static int |
getCurrentAudioRoute()
Get the current audio route |
static int |
getDebugLevel()
Returns current global debug level. |
static int |
getFrameSnapshot(short[] left,
short[] right)
If startFrameSnapshot() has been called, and it returned true, then calls to getFrameSnapshot() will return a copy of the last audio buffer sent to the hardware. |
static Bitmap |
getMediaStreamIcon(int id)
Get the icon for the given media id. |
static int |
getMediaStreamPlayerIDFromName(String name)
Get the media id from the player name. |
static String |
getMediaStreamPlayerName(int id)
Get the name of the player from the media id. |
static int |
getMediaStreamVolume(int id)
Get the volume for the given stream. |
static int |
getMixerRate()
returns sample rate of audio mixer |
static int |
getRecordMonitorLevel()
Get record monitor level |
static int |
getTime()
get current tick in microseconds One thousand microseconds equal 1 millisecond. |
static int |
getTimePlusEighthSecond()
|
static int |
getTimePlusHalfSecond()
|
static int |
getTimePlusOneSecond()
|
static int |
getTimePlusQuarterSecond()
|
static boolean |
includesDebugLevel(int level)
Returns true if global debug level includes the specified level OS 3.0 |
static void |
initializeFromSysApp()
|
static void |
installImpl(danger.audio.AudioManagerImpl inImpl)
|
static boolean |
isActive()
returns true, if audio system is generating audio |
static boolean |
isBuiltIn()
test to see if audio system is built into rom |
static boolean |
isMediaPlayerRegistered(Listener listener)
|
static boolean |
isMediaStream(int id)
Get the volume for the given stream. |
static boolean |
isMediaStreamPlaying(int id)
Returns true if the media stream with this id is playing. |
static boolean |
isRecording()
Are we recording? |
static Object |
load(byte[] data)
Given a byte stream, figure out what kind of audio file it is, if any, and load it. |
static Object |
load(File file)
Given a File, figure out what kind of audio file it is, if any, and load it. |
static PlayableAudio |
load(File file,
boolean autoDelete)
Given a File, figure out what kind of audio file it is, if any, and load it, with the ability to determine whether it is auto-deleted or not. |
static Object |
play(byte[] data)
Given a byte stream, figure out what kind of audio file it is, if any, and play it. |
static Object |
play(File file)
Given a File, figure out what kind of audio file it is, if any, and play it. |
static void |
playDTMFTone(char toneKey,
int signalLengthInMS,
int gapBetweenSignalInMS,
int volume)
play DTMF tones syncronously. |
static void |
playDTMFToneAsync(char toneKey,
int signalLengthInMS,
int gapBetweenSignalInMS,
int volume)
play one DTMF tone asyncronously. |
static void |
playDTMFToneString(String tones,
int signalLengthInMS,
int gapBetweenSignalInMS,
int volume)
play one DTMF tone syncronously. |
static void |
playDTMFToneStringAsync(String tones,
int signalLengthInMS,
int gapBetweenSignalInMS,
int volume)
play DTMF tones asyncronously. |
static boolean |
recognize(File file)
Given a File, return whether or not the file is recognized as audio. |
static void |
registerForAudioEvents(Listener inListener)
Register a Listener object to receive audio events |
static int |
registerMediaPlayer(Listener listener,
String name,
Bitmap icon)
Register a media player to be controlled by the sound controls. |
static void |
setDebugLevel(int level)
Set the global debug level |
static void |
setMediaStreamVolume(int id,
int volume)
Set the volume for the given stream. |
static void |
start(Object object,
int filters)
Given an object created with AudioManager.play() or AudioManager.load() start it playing with a given ToneFilter |
static boolean |
startFrameSnapshot()
Turn on snapshot mode. |
static void |
stop(Object object)
Given an object created with AudioManager.play() or AudioManager.load() stop it from playing and destroy it. |
static void |
stopFrameSnapshot()
Call after finished capturing audio snapshots. |
static void |
testTone(boolean status)
turn on/off a test tone. |
static void |
testToneFrequency(int frequency)
When the tone is enabled, play this frequency. |
static void |
unregisterForAudioEvents(Listener inListener)
Unregister a Listener object to receive audio events |
static void |
vibrate(int inDuration)
-1 = on, 0 = off, > 0 = duration in milliseconds |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
|---|
public static final String kAudioRouteSilent
public static final String kAudioRouteOldPlayback
public static final String kAudioRouteOldRecord
public static final String kAudioRouteOldPhone
public static final String kAudioRouteOldSpeakerPhone
public static final String kAudioRoutePlaybackSpeaker
public static final String kAudioRoutePlaybackHeadset
public static final String kAudioRoutePlaybackBluetooth
public static final String kAudioRoutePhone
public static final String kAudioRoutePhoneHeadset
public static final String kAudioRouteSpeakerphone
public static final String kAudioRouteBluetoothPhone
public static final String kAudioRouteRecord
public static final String kAudioRouteRecordHeadset
public static final String kAudioRouteRecordBluetooth
public static final String kAudioRouteUnknown
public static final int NOW
public static final int ONE_SECOND
public static final int HALF_SECOND
public static final int QUARTER_SECOND
public static final int EIGHTH_SECOND
public static final int DEBUG_NONE
public static final int DEBUG_GENERAL
public static final int DEBUG_SYSTEM
public static final int DEBUG_PLAYABLE
public static final int DEBUG_SOUND
public static final int DEBUG_STREAM
public static final int DEBUG_SEQUENCE
public static final int MEDIA_NONE
public static final int MEDIA_ANY
| Constructor Detail |
|---|
public AudioManager()
| Method Detail |
|---|
public static void installImpl(danger.audio.AudioManagerImpl inImpl)
public static void initializeFromSysApp()
public static boolean isActive()
public static boolean isBuiltIn()
public static int getMixerRate()
public static void setDebugLevel(int level)
public static int getDebugLevel()
public static boolean includesDebugLevel(int level)
public static void vibrate(int inDuration)
public static void playDTMFToneStringAsync(String tones,
int signalLengthInMS,
int gapBetweenSignalInMS,
int volume)
public static void playDTMFToneAsync(char toneKey,
int signalLengthInMS,
int gapBetweenSignalInMS,
int volume)
public static void playDTMFTone(char toneKey,
int signalLengthInMS,
int gapBetweenSignalInMS,
int volume)
public static void playDTMFToneString(String tones,
int signalLengthInMS,
int gapBetweenSignalInMS,
int volume)
public static void testToneFrequency(int frequency)
public static void testTone(boolean status)
public static boolean canCreateRecorder()
public static boolean isRecording()
public static int getRecordMonitorLevel()
public static Recorder createRecorder()
throws AudioException
AudioException
public static Sequence createSequence(boolean autoDelete,
int type)
throws AudioException
AudioException
public static Sequence createSequence(boolean autoDelete)
throws AudioException
AudioException
public static Sequence createSequence()
throws AudioException
AudioException
public static Sound createSound(boolean autoDelete,
int type)
throws AudioException
AudioException
public static Sound createSound(boolean autoDelete)
throws AudioException
AudioException
public static Sound createSound()
throws AudioException
AudioException
public static Stream createStream(boolean autoDelete,
int type)
throws AudioException
AudioException
public static Stream createStream(boolean autoDelete)
throws AudioException
AudioException
public static Stream createStream()
throws AudioException
AudioExceptionpublic static void registerForAudioEvents(Listener inListener)
public static void unregisterForAudioEvents(Listener inListener)
public static void eventAudio(Event event)
public static int getCurrentAudioRoute()
public static String getCodecMimeType(int fileType)
public static boolean startFrameSnapshot()
public static int getFrameSnapshot(short[] left,
short[] right)
public static void stopFrameSnapshot()
public static int getTime()
public static int getTimePlusQuarterSecond()
public static int getTimePlusHalfSecond()
public static int getTimePlusOneSecond()
public static int getTimePlusEighthSecond()
public static Object load(byte[] data)
public static Object load(File file)
public static boolean recognize(File file)
public static PlayableAudio load(File file,
boolean autoDelete)
public static Object play(byte[] data)
public static Object play(File file)
public static void start(Object object,
int filters)
public static void stop(Object object)
public static int registerMediaPlayer(Listener listener,
String name,
Bitmap icon)
EventType.EVENT_AUDIO_MEDIA_VOLUME_CHANGE_REQUESTED event.
The what field of the event contains the media id.
The data field of the event contains the new volume value.
listener - non-null; The target listener.icon - null-ok; The icon to use in the sound controls.
public static void setMediaStreamVolume(int id,
int volume)
id - The id of the media stream
OS: 3.0public static int getMediaStreamVolume(int id)
id - The id of the media stream
OS: 3.0public static boolean isMediaStreamPlaying(int id)
id - The id of a media stream -
Use MEDIA_ANY to see if any media streams are playing.
public static Bitmap getMediaStreamIcon(int id)
id - The id of a media stream.
public static String getMediaStreamPlayerName(int id)
id - The id of a media stream.
public static int getMediaStreamPlayerIDFromName(String name)
The - media player name.
public static boolean isMediaStream(int id)
id - The id of the media stream
OS: 3.0public static boolean isMediaPlayerRegistered(Listener listener)
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||