/**@class android.media.AudioSystem @extends java.lang.Object @hide */ var AudioSystem = { /**Used to identify the default audio stream volume */ STREAM_DEFAULT : "-1", /**Used to identify the volume of audio streams for phone calls */ STREAM_VOICE_CALL : "0", /**Used to identify the volume of audio streams for system sounds */ STREAM_SYSTEM : "1", /**Used to identify the volume of audio streams for the phone ring and message alerts */ STREAM_RING : "2", /**Used to identify the volume of audio streams for music playback */ STREAM_MUSIC : "3", /**Used to identify the volume of audio streams for alarms */ STREAM_ALARM : "4", /**Used to identify the volume of audio streams for notifications */ STREAM_NOTIFICATION : "5", /**Used to identify the volume of audio streams for phone calls when connected on bluetooth */ STREAM_BLUETOOTH_SCO : "6", /**Used to identify the volume of audio streams for enforced system sounds in certain countries (e.g camera in Japan) */ STREAM_SYSTEM_ENFORCED : "7", /**Used to identify the volume of audio streams for DTMF tones */ STREAM_DTMF : "8", /**Used to identify the volume of audio streams exclusively transmitted through the speaker (TTS) of the device */ STREAM_TTS : "9", /**Used to identify the volume of audio streams for accessibility prompts */ STREAM_ACCESSIBILITY : "10", /** @deprecated Use {@link #numStreamTypes() instead} */ NUM_STREAMS : "5", /**Maximum value for AudioTrack channel count @hide public for MediaCode only, do not un-hide or change to a numeric literal */ OUT_CHANNEL_COUNT_MAX : "null", /***/ STREAM_NAMES : "null", /***/ MODE_INVALID : "-2", /***/ MODE_CURRENT : "-1", /***/ MODE_NORMAL : "0", /***/ MODE_RINGTONE : "1", /***/ MODE_IN_CALL : "2", /***/ MODE_IN_COMMUNICATION : "3", /***/ NUM_MODES : "4", /***/ AUDIO_FORMAT_INVALID : "-1", /***/ AUDIO_FORMAT_DEFAULT : "0", /***/ AUDIO_FORMAT_AAC : "67108864", /***/ AUDIO_FORMAT_SBC : "520093696", /***/ AUDIO_FORMAT_APTX : "536870912", /***/ AUDIO_FORMAT_APTX_HD : "553648128", /***/ AUDIO_FORMAT_LDAC : "587202560", /**@deprecated */ ROUTE_EARPIECE : "1", /**@deprecated */ ROUTE_SPEAKER : "2", /**@deprecated use {@link #ROUTE_BLUETOOTH_SCO} */ ROUTE_BLUETOOTH : "4", /**@deprecated */ ROUTE_BLUETOOTH_SCO : "4", /**@deprecated */ ROUTE_HEADSET : "8", /**@deprecated */ ROUTE_BLUETOOTH_A2DP : "16", /**@deprecated */ ROUTE_ALL : "-1", /***/ AUDIO_SESSION_ALLOCATE : "0", /***/ AUDIO_STATUS_OK : "0", /***/ AUDIO_STATUS_ERROR : "1", /***/ AUDIO_STATUS_SERVER_DIED : "100", /***/ SUCCESS : "0", /***/ ERROR : "-1", /***/ BAD_VALUE : "-2", /***/ INVALID_OPERATION : "-3", /***/ PERMISSION_DENIED : "-4", /***/ NO_INIT : "-5", /***/ DEAD_OBJECT : "-6", /***/ WOULD_BLOCK : "-7", /***/ DEVICE_NONE : "0", /***/ DEVICE_BIT_IN : "-2147483648", /***/ DEVICE_BIT_DEFAULT : "1073741824", /***/ DEVICE_OUT_EARPIECE : "1", /***/ DEVICE_OUT_SPEAKER : "2", /***/ DEVICE_OUT_WIRED_HEADSET : "4", /***/ DEVICE_OUT_WIRED_HEADPHONE : "8", /***/ DEVICE_OUT_BLUETOOTH_SCO : "16", /***/ DEVICE_OUT_BLUETOOTH_SCO_HEADSET : "32", /***/ DEVICE_OUT_BLUETOOTH_SCO_CARKIT : "64", /***/ DEVICE_OUT_BLUETOOTH_A2DP : "128", /***/ DEVICE_OUT_BLUETOOTH_A2DP_HEADPHONES : "256", /***/ DEVICE_OUT_BLUETOOTH_A2DP_SPEAKER : "512", /***/ DEVICE_OUT_AUX_DIGITAL : "1024", /***/ DEVICE_OUT_HDMI : "1024", /***/ DEVICE_OUT_ANLG_DOCK_HEADSET : "2048", /***/ DEVICE_OUT_DGTL_DOCK_HEADSET : "4096", /***/ DEVICE_OUT_USB_ACCESSORY : "8192", /***/ DEVICE_OUT_USB_DEVICE : "16384", /***/ DEVICE_OUT_REMOTE_SUBMIX : "32768", /***/ DEVICE_OUT_TELEPHONY_TX : "65536", /***/ DEVICE_OUT_LINE : "131072", /***/ DEVICE_OUT_HDMI_ARC : "262144", /***/ DEVICE_OUT_SPDIF : "524288", /***/ DEVICE_OUT_FM : "1048576", /***/ DEVICE_OUT_AUX_LINE : "2097152", /***/ DEVICE_OUT_SPEAKER_SAFE : "4194304", /***/ DEVICE_OUT_IP : "8388608", /***/ DEVICE_OUT_BUS : "16777216", /***/ DEVICE_OUT_PROXY : "33554432", /***/ DEVICE_OUT_USB_HEADSET : "67108864", /***/ DEVICE_OUT_HEARING_AID : "134217728", /***/ DEVICE_OUT_DEFAULT : "1073741824", /***/ DEVICE_OUT_ALL : "1342177279", /***/ DEVICE_OUT_ALL_A2DP : "896", /***/ DEVICE_OUT_ALL_SCO : "112", /***/ DEVICE_OUT_ALL_USB : "67133440", /***/ DEVICE_OUT_ALL_HDMI_SYSTEM_AUDIO : "2883584", /***/ DEVICE_ALL_HDMI_SYSTEM_AUDIO_AND_SPEAKER : "2883586", /***/ DEVICE_IN_COMMUNICATION : "-2147483647", /***/ DEVICE_IN_AMBIENT : "-2147483646", /***/ DEVICE_IN_BUILTIN_MIC : "-2147483644", /***/ DEVICE_IN_BLUETOOTH_SCO_HEADSET : "-2147483640", /***/ DEVICE_IN_WIRED_HEADSET : "-2147483632", /***/ DEVICE_IN_AUX_DIGITAL : "-2147483616", /***/ DEVICE_IN_HDMI : "-2147483616", /***/ DEVICE_IN_VOICE_CALL : "-2147483584", /***/ DEVICE_IN_TELEPHONY_RX : "-2147483584", /***/ DEVICE_IN_BACK_MIC : "-2147483520", /***/ DEVICE_IN_REMOTE_SUBMIX : "-2147483392", /***/ DEVICE_IN_ANLG_DOCK_HEADSET : "-2147483136", /***/ DEVICE_IN_DGTL_DOCK_HEADSET : "-2147482624", /***/ DEVICE_IN_USB_ACCESSORY : "-2147481600", /***/ DEVICE_IN_USB_DEVICE : "-2147479552", /***/ DEVICE_IN_FM_TUNER : "-2147475456", /***/ DEVICE_IN_TV_TUNER : "-2147467264", /***/ DEVICE_IN_LINE : "-2147450880", /***/ DEVICE_IN_SPDIF : "-2147418112", /***/ DEVICE_IN_BLUETOOTH_A2DP : "-2147352576", /***/ DEVICE_IN_LOOPBACK : "-2147221504", /***/ DEVICE_IN_IP : "-2146959360", /***/ DEVICE_IN_BUS : "-2146435072", /***/ DEVICE_IN_PROXY : "-2130706432", /***/ DEVICE_IN_USB_HEADSET : "-2113929216", /***/ DEVICE_IN_BLUETOOTH_BLE : "-2080374784", /***/ DEVICE_IN_HDMI_ARC : "-2013265920", /***/ DEVICE_IN_ECHO_REFERENCE : "-1879048192", /***/ DEVICE_IN_DEFAULT : "-1073741824", /***/ DEVICE_IN_ALL : "-551550977", /***/ DEVICE_IN_ALL_SCO : "-2147483640", /***/ DEVICE_IN_ALL_USB : "-2113923072", /***/ DEVICE_STATE_UNAVAILABLE : "0", /***/ DEVICE_STATE_AVAILABLE : "1", /***/ DEVICE_OUT_EARPIECE_NAME : "earpiece", /***/ DEVICE_OUT_SPEAKER_NAME : "speaker", /***/ DEVICE_OUT_WIRED_HEADSET_NAME : "headset", /***/ DEVICE_OUT_WIRED_HEADPHONE_NAME : "headphone", /***/ DEVICE_OUT_BLUETOOTH_SCO_NAME : "bt_sco", /***/ DEVICE_OUT_BLUETOOTH_SCO_HEADSET_NAME : "bt_sco_hs", /***/ DEVICE_OUT_BLUETOOTH_SCO_CARKIT_NAME : "bt_sco_carkit", /***/ DEVICE_OUT_BLUETOOTH_A2DP_NAME : "bt_a2dp", /***/ DEVICE_OUT_BLUETOOTH_A2DP_HEADPHONES_NAME : "bt_a2dp_hp", /***/ DEVICE_OUT_BLUETOOTH_A2DP_SPEAKER_NAME : "bt_a2dp_spk", /***/ DEVICE_OUT_AUX_DIGITAL_NAME : "aux_digital", /***/ DEVICE_OUT_HDMI_NAME : "hdmi", /***/ DEVICE_OUT_ANLG_DOCK_HEADSET_NAME : "analog_dock", /***/ DEVICE_OUT_DGTL_DOCK_HEADSET_NAME : "digital_dock", /***/ DEVICE_OUT_USB_ACCESSORY_NAME : "usb_accessory", /***/ DEVICE_OUT_USB_DEVICE_NAME : "usb_device", /***/ DEVICE_OUT_REMOTE_SUBMIX_NAME : "remote_submix", /***/ DEVICE_OUT_TELEPHONY_TX_NAME : "telephony_tx", /***/ DEVICE_OUT_LINE_NAME : "line", /***/ DEVICE_OUT_HDMI_ARC_NAME : "hmdi_arc", /***/ DEVICE_OUT_SPDIF_NAME : "spdif", /***/ DEVICE_OUT_FM_NAME : "fm_transmitter", /***/ DEVICE_OUT_AUX_LINE_NAME : "aux_line", /***/ DEVICE_OUT_SPEAKER_SAFE_NAME : "speaker_safe", /***/ DEVICE_OUT_IP_NAME : "ip", /***/ DEVICE_OUT_BUS_NAME : "bus", /***/ DEVICE_OUT_PROXY_NAME : "proxy", /***/ DEVICE_OUT_USB_HEADSET_NAME : "usb_headset", /***/ DEVICE_OUT_HEARING_AID_NAME : "hearing_aid_out", /***/ DEVICE_IN_COMMUNICATION_NAME : "communication", /***/ DEVICE_IN_AMBIENT_NAME : "ambient", /***/ DEVICE_IN_BUILTIN_MIC_NAME : "mic", /***/ DEVICE_IN_BLUETOOTH_SCO_HEADSET_NAME : "bt_sco_hs", /***/ DEVICE_IN_WIRED_HEADSET_NAME : "headset", /***/ DEVICE_IN_AUX_DIGITAL_NAME : "aux_digital", /***/ DEVICE_IN_TELEPHONY_RX_NAME : "telephony_rx", /***/ DEVICE_IN_BACK_MIC_NAME : "back_mic", /***/ DEVICE_IN_REMOTE_SUBMIX_NAME : "remote_submix", /***/ DEVICE_IN_ANLG_DOCK_HEADSET_NAME : "analog_dock", /***/ DEVICE_IN_DGTL_DOCK_HEADSET_NAME : "digital_dock", /***/ DEVICE_IN_USB_ACCESSORY_NAME : "usb_accessory", /***/ DEVICE_IN_USB_DEVICE_NAME : "usb_device", /***/ DEVICE_IN_FM_TUNER_NAME : "fm_tuner", /***/ DEVICE_IN_TV_TUNER_NAME : "tv_tuner", /***/ DEVICE_IN_LINE_NAME : "line", /***/ DEVICE_IN_SPDIF_NAME : "spdif", /***/ DEVICE_IN_BLUETOOTH_A2DP_NAME : "bt_a2dp", /***/ DEVICE_IN_LOOPBACK_NAME : "loopback", /***/ DEVICE_IN_IP_NAME : "ip", /***/ DEVICE_IN_BUS_NAME : "bus", /***/ DEVICE_IN_PROXY_NAME : "proxy", /***/ DEVICE_IN_USB_HEADSET_NAME : "usb_headset", /***/ DEVICE_IN_BLUETOOTH_BLE_NAME : "bt_ble", /***/ DEVICE_IN_ECHO_REFERENCE_NAME : "echo_reference", /***/ DEVICE_IN_HDMI_ARC_NAME : "hdmi_arc", /***/ PHONE_STATE_OFFCALL : "0", /***/ PHONE_STATE_RINGING : "1", /***/ PHONE_STATE_INCALL : "2", /***/ FORCE_NONE : "0", /***/ FORCE_SPEAKER : "1", /***/ FORCE_HEADPHONES : "2", /***/ FORCE_BT_SCO : "3", /***/ FORCE_BT_A2DP : "4", /***/ FORCE_WIRED_ACCESSORY : "5", /***/ FORCE_BT_CAR_DOCK : "6", /***/ FORCE_BT_DESK_DOCK : "7", /***/ FORCE_ANALOG_DOCK : "8", /***/ FORCE_DIGITAL_DOCK : "9", /***/ FORCE_NO_BT_A2DP : "10", /***/ FORCE_SYSTEM_ENFORCED : "11", /***/ FORCE_HDMI_SYSTEM_AUDIO_ENFORCED : "12", /***/ FORCE_ENCODED_SURROUND_NEVER : "13", /***/ FORCE_ENCODED_SURROUND_ALWAYS : "14", /***/ FORCE_ENCODED_SURROUND_MANUAL : "15", /***/ NUM_FORCE_CONFIG : "16", /***/ FORCE_DEFAULT : "0", /***/ FOR_COMMUNICATION : "0", /***/ FOR_MEDIA : "1", /***/ FOR_RECORD : "2", /***/ FOR_DOCK : "3", /***/ FOR_SYSTEM : "4", /***/ FOR_HDMI_SYSTEM_AUDIO : "5", /***/ FOR_ENCODED_SURROUND : "6", /***/ FOR_VIBRATE_RINGING : "7", /***/ SYNC_EVENT_NONE : "0", /***/ SYNC_EVENT_PRESENTATION_COMPLETE : "1", /***/ AUDIO_HW_SYNC_INVALID : "0", /** The delay before playing a sound. This small period exists so the user can press another key (non-volume keys, too) to have it NOT be audible. <p> PhoneWindow will implement this part. */ PLAY_SOUND_DELAY : "300", /** Constant to identify a focus stack entry that is used to hold the focus while the phone is ringing or during a call. Used by com.android.internal.telephony.CallManager when entering and exiting calls. */ IN_VOICE_COMM_FOCUS_ID : "AudioFocus_For_Phone_Ring_And_Calls", /***/ DEFAULT_STREAM_VOLUME : "null", /**The platform has no specific capabilities */ PLATFORM_DEFAULT : "0", /**The platform is voice call capable (a phone) */ PLATFORM_VOICE : "1", /**The platform is a television or a set-top box */ PLATFORM_TELEVISION : "2", /***/ DEFAULT_MUTE_STREAMS_AFFECTED : "111", /** */ getNumStreamTypes : function( ) {}, /** */ muteMicrophone : function( ) {}, /** */ isMicrophoneMuted : function( ) {}, /** */ modeToString : function( ) {}, /**Convert audio format enum values to Bluetooth codec values */ audioFormatToBluetoothSourceCodec : function( ) {}, /** */ isStreamActive : function( ) {}, /** */ isStreamActiveRemotely : function( ) {}, /** */ isSourceActive : function( ) {}, /** */ newAudioSessionId : function( ) {}, /** */ newAudioPlayerId : function( ) {}, /**Returns a new unused audio recorder ID */ newAudioRecorderId : function( ) {}, /** */ setParameters : function( ) {}, /** */ getParameters : function( ) {}, /** */ setErrorCallback : function( ) {}, /** */ setDynamicPolicyCallback : function( ) {}, /** */ setRecordingCallback : function( ) {}, /** */ deviceStateToString : function( ) {}, /** */ getOutputDeviceName : function( ) {}, /** */ getInputDeviceName : function( ) {}, /** */ forceUseConfigToString : function( ) {}, /** */ forceUseUsageToString : function( ) {}, /**Wrapper for native methods called from AudioService */ setStreamVolumeIndexAS : function( ) {}, /** @return {Number} command completion status, one of {@link #AUDIO_STATUS_OK}, {@link #AUDIO_STATUS_ERROR} or {@link #AUDIO_STATUS_SERVER_DIED} */ setDeviceConnectionState : function( ) {}, /** */ getDeviceConnectionState : function( ) {}, /** */ handleDeviceConfigChange : function( ) {}, /** */ setPhoneState : function( ) {}, /** */ setForceUse : function( ) {}, /** */ getForceUse : function( ) {}, /** */ initStreamVolume : function( ) {}, /** */ getStreamVolumeIndex : function( ) {}, /** @param {Object {AudioAttributes}} attributes the {@link AudioAttributes} to be considered @param {Number} index to be applied @param {Number} device the volume device to be considered @param device the volume device to be considered @return {Number} command completion status. */ setVolumeIndexForAttributes : function( ) {}, /** @param {Object {AudioAttributes}} attributes the {@link AudioAttributes} to be considered @param {Number} device the volume device to be considered @param device the volume device to be considered @return {Number} volume index for the given {@link AudioAttributes} and volume device. */ getVolumeIndexForAttributes : function( ) {}, /** @param {Object {AudioAttributes}} attributes the {@link AudioAttributes} to be considered @param attributes the {@link AudioAttributes} to be considered @return {Number} minimum volume index for the given {@link AudioAttributes}. */ getMinVolumeIndexForAttributes : function( ) {}, /** @param {Object {AudioAttributes}} attributes the {@link AudioAttributes} to be considered @param attributes the {@link AudioAttributes} to be considered @return {Number} maximum volume index for the given {@link AudioAttributes}. */ getMaxVolumeIndexForAttributes : function( ) {}, /** */ setMasterVolume : function( ) {}, /** */ getMasterVolume : function( ) {}, /** */ setMasterMute : function( ) {}, /** */ getMasterMute : function( ) {}, /** */ getDevicesForStream : function( ) {}, /** @hide returns true if master mono is enabled. */ getMasterMono : function( ) {}, /** @hide enables or disables the master mono mode. */ setMasterMono : function( ) {}, /** @hide enables or disables the RTT mode. */ setRttEnabled : function( ) {}, /** @hide returns master balance value in range -1.f -> 1.f, where 0.f is dead center. */ getMasterBalance : function( ) {}, /** @hide changes the audio balance of the device. */ setMasterBalance : function( ) {}, /** */ getPrimaryOutputSamplingRate : function( ) {}, /** */ getPrimaryOutputFrameCount : function( ) {}, /** */ getOutputLatency : function( ) {}, /** */ setLowRamDevice : function( ) {}, /** */ checkAudioFlinger : function( ) {}, /** */ listAudioPorts : function( ) {}, /** */ createAudioPatch : function( ) {}, /** */ releaseAudioPatch : function( ) {}, /** */ listAudioPatches : function( ) {}, /** */ setAudioPortConfig : function( ) {}, /** */ startAudioSource : function( ) {}, /** */ stopAudioSource : function( ) {}, /** */ getAudioHwSyncForSession : function( ) {}, /** */ registerPolicyMixes : function( ) {}, /**see AudioPolicy.setUidDeviceAffinities() */ setUidDeviceAffinities : function( ) {}, /**see AudioPolicy.removeUidDeviceAffinities() */ removeUidDeviceAffinities : function( ) {}, /** */ systemReady : function( ) {}, /** */ getStreamVolumeDB : function( ) {}, /** @see AudioManager#setAllowedCapturePolicy() */ setAllowedCapturePolicy : function( ) {}, /** */ getMicrophones : function( ) {}, /** */ getSurroundFormats : function( ) {}, /**Returns a list of audio formats (codec) supported on the A2DP offload path. */ getHwOffloadEncodingFormatsSupportedForA2DP : function( ) {}, /** */ setSurroundFormatEnabled : function( ) {}, /**Communicate UID of active assistant to audio policy service. */ setAssistantUid : function( ) {}, /**Communicate UIDs of active accessibility services to audio policy service. */ setA11yServicesUids : function( ) {}, /** @see AudioManager#isHapticPlaybackSupported() */ isHapticPlaybackSupported : function( ) {}, /** @see AudioManager#setVibrateSetting(int, int) */ getValueForVibrateSetting : function( ) {}, /** */ getDefaultStreamVolume : function( ) {}, /** */ streamToString : function( ) {}, /**Return the platform type that this is running on. One of: <ul> <li>{@link #PLATFORM_VOICE}</li> <li>{@link #PLATFORM_TELEVISION}</li> <li>{@link #PLATFORM_DEFAULT}</li> </ul> */ getPlatformType : function( ) {}, /** @hide @return {Boolean} whether the system uses a single volume stream. */ isSingleVolume : function( ) {}, };