Java android.media AudioManager fields, constructors, methods, implement or subclass

Example usage for Java android.media AudioManager fields, constructors, methods, implement or subclass

Introduction

In this page you can find the methods, fields and constructors for android.media AudioManager.

The text is from its open source code.

Field

StringACTION_AUDIO_BECOMING_NOISY
Broadcast intent, a hint for applications that audio is about to become 'noisy' due to a change in audio outputs.
StringRINGER_MODE_CHANGED_ACTION
Sticky broadcast intent action indicating that the ringer mode has changed.
StringEXTRA_RINGER_MODE
The new ringer mode.
StringACTION_HEADSET_PLUG
Broadcast Action: Wired Headset plugged in or unplugged.
StringACTION_HDMI_AUDIO_PLUG
Broadcast Action: A sticky broadcast indicating an HDMI cable was plugged or unplugged.
intSTREAM_VOICE_CALL
Used to identify the volume of audio streams for phone calls
intSTREAM_SYSTEM
Used to identify the volume of audio streams for system sounds
intSTREAM_RING
Used to identify the volume of audio streams for the phone ring
intSTREAM_MUSIC
Used to identify the volume of audio streams for music playback
intSTREAM_ALARM
Used to identify the volume of audio streams for alarms
intSTREAM_NOTIFICATION
Used to identify the volume of audio streams for notifications
intSTREAM_DTMF
Used to identify the volume of audio streams for DTMF Tones
intADJUST_RAISE
Increase the ringer volume.
intADJUST_LOWER
Decrease the ringer volume.
intADJUST_SAME
Maintain the previous ringer volume.
intADJUST_MUTE
Mute the volume.
intADJUST_UNMUTE
Unmute the volume.
intADJUST_TOGGLE_MUTE
Toggle the mute state.
intFLAG_SHOW_UI
Show a toast containing the current volume.
intFLAG_ALLOW_RINGER_MODES
Whether to include ringer modes as possible options when changing volume.
intFLAG_PLAY_SOUND
Whether to play a sound when changing the volume.
intFLAG_REMOVE_SOUND_AND_VIBRATE
Removes any sounds/vibrate that may be in the queue, or are playing (related to changing volume).
intRINGER_MODE_SILENT
Ringer mode that will be silent and will not vibrate.
intRINGER_MODE_VIBRATE
Ringer mode that will be silent and will vibrate.
intRINGER_MODE_NORMAL
Ringer mode that may be audible and may vibrate.
intVIBRATE_TYPE_RINGER
Vibrate type that corresponds to the ringer.
intVIBRATE_SETTING_OFF
Vibrate setting that suggests to never vibrate.
intVIBRATE_SETTING_ON
Vibrate setting that suggests to vibrate when possible.
intUSE_DEFAULT_STREAM_TYPE
Suggests using the default stream type.
StringACTION_SCO_AUDIO_STATE_CHANGED
Sticky broadcast intent action indicating that the Bluetooth SCO audio connection state has changed.
StringACTION_SCO_AUDIO_STATE_UPDATED
Sticky broadcast intent action indicating that the Bluetooth SCO audio connection state has been updated.
intMODE_INVALID
Invalid audio mode.
intMODE_NORMAL
Normal audio mode: not ringing and no call established.
intMODE_RINGTONE
Ringing audio mode.
intMODE_IN_CALL
In call audio mode.
intMODE_IN_COMMUNICATION
In communication audio mode.
intROUTE_EARPIECE
Routing audio output to earpiece
intROUTE_SPEAKER
Routing audio output to speaker
intROUTE_ALL
Used for mask parameter of #setRouting(int,int,int) .
intFX_KEY_CLICK
Keyboard and direction pad click sound
intFX_FOCUS_NAVIGATION_LEFT
Focus has moved left
intFX_FOCUS_NAVIGATION_RIGHT
Focus has moved right
intFX_KEYPRESS_STANDARD
IME standard keypress sound
intFX_KEYPRESS_SPACEBAR
IME spacebar keypress sound
intFX_KEYPRESS_DELETE
IME delete keypress sound
intFX_KEYPRESS_RETURN
IME return_keypress sound
intAUDIOFOCUS_NONE
Used to indicate no audio focus has been gained or lost, or requested.
intAUDIOFOCUS_GAIN
Used to indicate a gain of audio focus, or a request of audio focus, of unknown duration.
intAUDIOFOCUS_GAIN_TRANSIENT
Used to indicate a temporary gain or request of audio focus, anticipated to last a short amount of time.
intAUDIOFOCUS_GAIN_TRANSIENT_MAY_DUCK
Used to indicate a temporary request of audio focus, anticipated to last a short amount of time, and where it is acceptable for other audio applications to keep playing after having lowered their output level (also referred to as "ducking").
intAUDIOFOCUS_GAIN_TRANSIENT_EXCLUSIVE
Used to indicate a temporary request of audio focus, anticipated to last a short amount of time, during which no other applications, or system components, should play anything.
intAUDIOFOCUS_LOSS
Used to indicate a loss of audio focus of unknown duration.
intAUDIOFOCUS_LOSS_TRANSIENT
Used to indicate a transient loss of audio focus.
intAUDIOFOCUS_LOSS_TRANSIENT_CAN_DUCK
Used to indicate a transient loss of audio focus where the loser of the audio focus can lower its output volume if it wants to continue playing (also referred to as "ducking"), as the new focus owner doesn't require others to be silent.
intAUDIOFOCUS_REQUEST_FAILED
A failed focus change request.
intAUDIOFOCUS_REQUEST_GRANTED
A successful focus change request.
intAUDIOFOCUS_REQUEST_DELAYED
A focus change request whose granting is delayed: the request was successful, but the requester will only be granted audio focus once the condition that prevented immediate granting has ended.
StringPROPERTY_OUTPUT_SAMPLE_RATE
Used as a key for #getProperty to request the native or optimal output sample rate for this device's low latency output stream, in decimal Hz.
StringPROPERTY_OUTPUT_FRAMES_PER_BUFFER
Used as a key for #getProperty to request the native or optimal output buffer size for this device's low latency output stream, in decimal PCM frames.
intGET_DEVICES_INPUTS
Specifies to the AudioManager#getDevices(int) method to include source (i.e.
intGET_DEVICES_OUTPUTS
Specifies to the AudioManager#getDevices(int) method to include sink (i.e.

Method

intabandonAudioFocus(OnAudioFocusChangeListener l)
Abandon audio focus.
voidadjustStreamVolume(int streamType, int direction, int flags)
Adjusts the volume of a particular stream by one step in a direction.
voidadjustSuggestedStreamVolume(int direction, int suggestedStreamType, int flags)
Adjusts the volume of the most relevant stream, or the given fallback stream.
voidadjustVolume(int direction, int flags)
Adjusts the volume of the most relevant stream.
intgenerateAudioSessionId()
Return a new audio session identifier not associated with any player or effect.
AudioDeviceInfo[]getDevices(int flags)
Returns an array of AudioDeviceInfo objects corresponding to the audio devices currently connected to the system and meeting the criteria specified in the flags parameter.
intgetMode()
Returns the current audio mode.
StringgetProperty(String key)
Returns the value of the property with the specified key.
intgetRingerMode()
Returns the current ringtone mode.
intgetRouting(int mode)
Returns the current audio routing bit vector for a specified mode.
intgetStreamMaxVolume(int streamType)
Returns the maximum volume index for a particular stream.
intgetStreamVolume(int streamType)
Returns the current volume index for a particular stream.
intgetVibrateSetting(int vibrateType)
Returns whether the user's vibrate setting for a vibrate type.
booleanisBluetoothA2dpOn()
Checks whether a Bluetooth A2DP audio peripheral is connected or not.
booleanisBluetoothScoAvailableOffCall()
Indicates if current platform supports use of SCO for off call use cases.
booleanisBluetoothScoOn()
Checks whether communications use Bluetooth SCO.
booleanisMicrophoneMute()
Checks whether the microphone mute is on or off.
booleanisMusicActive()
Checks whether any music is active.
booleanisSpeakerphoneOn()
Checks whether the speakerphone is on or off.
booleanisStreamMute(int streamType)
Returns the current mute state for a particular stream.
booleanisWiredHeadsetOn()
Checks whether a wired headset is connected or not.
voidplaySoundEffect(int effectType, int userId)
Plays a sound effect (Key clicks, lid open/close...)
voidplaySoundEffect(int effectType, float volume)
Plays a sound effect (Key clicks, lid open/close...)
voidplaySoundEffect(int effectType)
Plays a sound effect (Key clicks, lid open/close...)
voidregisterMediaButtonEventReceiver(ComponentName eventReceiver)
Register a component to be the sole receiver of MEDIA_BUTTON intents.
voidregisterMediaButtonEventReceiver(PendingIntent eventReceiver)
Register a component to be the sole receiver of MEDIA_BUTTON intents.
voidregisterRemoteControlClient(RemoteControlClient rcClient)
Registers the remote control client for providing information to display on the remote controls.
intrequestAudioFocus(OnAudioFocusChangeListener l, int streamType, int durationHint)
Request audio focus.
voidsetBluetoothScoOn(boolean on)
Request use of Bluetooth SCO headset for communications.
voidsetMicrophoneMute(boolean on)
Sets the microphone mute on or off.
voidsetMode(int mode)
Sets the audio mode.
voidsetParameters(String keyValuePairs)
Sets a variable number of parameter values to audio hardware.
voidsetRingerMode(int ringerMode)
Sets the ringer mode.
voidsetRouting(int mode, int routes, int mask)
Sets the audio routing for a specified mode
voidsetSpeakerphoneOn(boolean on)
Sets the speakerphone on or off.
voidsetStreamMute(int streamType, boolean state)
Mute or unmute an audio stream.
voidsetStreamSolo(int streamType, boolean state)
Solo or unsolo a particular stream.
voidsetStreamVolume(int streamType, int index, int flags)
Sets the volume index for a particular stream.
voidsetVibrateSetting(int vibrateType, int vibrateSetting)
Sets the setting for when the vibrate type should vibrate.
voidstartBluetoothSco()
Start bluetooth SCO audio connection.
voidstopBluetoothSco()
Stop bluetooth SCO audio connection.
voidunregisterMediaButtonEventReceiver(ComponentName eventReceiver)
Unregister the receiver of MEDIA_BUTTON intents.
voidunregisterMediaButtonEventReceiver(PendingIntent eventReceiver)
Unregister the receiver of MEDIA_BUTTON intents.
voidunregisterRemoteControlClient(RemoteControlClient rcClient)
Unregisters the remote control client that was providing information to display on the remote controls.