Fields Summary |
---|
public static final int | STREAM_DEFAULT |
public static final int | STREAM_VOICE_CALL |
public static final int | STREAM_SYSTEM |
public static final int | STREAM_RING |
public static final int | STREAM_MUSIC |
public static final int | STREAM_ALARM |
public static final int | STREAM_NOTIFICATION |
public static final int | STREAM_BLUETOOTH_SCO |
public static final int | STREAM_SYSTEM_ENFORCED |
public static final int | STREAM_DTMF |
public static final int | STREAM_TTS |
public static final int | NUM_STREAMS |
private static final int | NUM_STREAM_TYPES |
public static final int | MODE_INVALID |
public static final int | MODE_CURRENT |
public static final int | MODE_NORMAL |
public static final int | MODE_RINGTONE |
public static final int | MODE_IN_CALL |
public static final int | MODE_IN_COMMUNICATION |
public static final int | NUM_MODES |
public static final int | ROUTE_EARPIECE |
public static final int | ROUTE_SPEAKER |
public static final int | ROUTE_BLUETOOTH |
public static final int | ROUTE_BLUETOOTH_SCO |
public static final int | ROUTE_HEADSET |
public static final int | ROUTE_BLUETOOTH_A2DP |
public static final int | ROUTE_ALL |
public static final int | AUDIO_SESSION_ALLOCATE |
public static final int | AUDIO_STATUS_OK |
public static final int | AUDIO_STATUS_ERROR |
public static final int | AUDIO_STATUS_SERVER_DIED |
private static ErrorCallback | mErrorCallback |
public static final int | SUCCESS |
public static final int | ERROR |
public static final int | BAD_VALUE |
public static final int | INVALID_OPERATION |
public static final int | PERMISSION_DENIED |
public static final int | NO_INIT |
public static final int | DEAD_OBJECT |
public static final int | DEVICE_NONE |
public static final int | DEVICE_BIT_IN |
public static final int | DEVICE_BIT_DEFAULT |
public static final int | DEVICE_OUT_EARPIECE |
public static final int | DEVICE_OUT_SPEAKER |
public static final int | DEVICE_OUT_WIRED_HEADSET |
public static final int | DEVICE_OUT_WIRED_HEADPHONE |
public static final int | DEVICE_OUT_BLUETOOTH_SCO |
public static final int | DEVICE_OUT_BLUETOOTH_SCO_HEADSET |
public static final int | DEVICE_OUT_BLUETOOTH_SCO_CARKIT |
public static final int | DEVICE_OUT_BLUETOOTH_A2DP |
public static final int | DEVICE_OUT_BLUETOOTH_A2DP_HEADPHONES |
public static final int | DEVICE_OUT_BLUETOOTH_A2DP_SPEAKER |
public static final int | DEVICE_OUT_AUX_DIGITAL |
public static final int | DEVICE_OUT_HDMI |
public static final int | DEVICE_OUT_ANLG_DOCK_HEADSET |
public static final int | DEVICE_OUT_DGTL_DOCK_HEADSET |
public static final int | DEVICE_OUT_USB_ACCESSORY |
public static final int | DEVICE_OUT_USB_DEVICE |
public static final int | DEVICE_OUT_REMOTE_SUBMIX |
public static final int | DEVICE_OUT_TELEPHONY_TX |
public static final int | DEVICE_OUT_LINE |
public static final int | DEVICE_OUT_HDMI_ARC |
public static final int | DEVICE_OUT_SPDIF |
public static final int | DEVICE_OUT_FM |
public static final int | DEVICE_OUT_AUX_LINE |
public static final int | DEVICE_OUT_SPEAKER_SAFE |
public static final int | DEVICE_OUT_DEFAULT |
public static final int | DEVICE_OUT_ALL |
public static final int | DEVICE_OUT_ALL_A2DP |
public static final int | DEVICE_OUT_ALL_SCO |
public static final int | DEVICE_OUT_ALL_USB |
public static final int | DEVICE_OUT_ALL_HDMI_SYSTEM_AUDIO |
public static final int | DEVICE_ALL_HDMI_SYSTEM_AUDIO_AND_SPEAKER |
public static final int | DEVICE_IN_COMMUNICATION |
public static final int | DEVICE_IN_AMBIENT |
public static final int | DEVICE_IN_BUILTIN_MIC |
public static final int | DEVICE_IN_BLUETOOTH_SCO_HEADSET |
public static final int | DEVICE_IN_WIRED_HEADSET |
public static final int | DEVICE_IN_AUX_DIGITAL |
public static final int | DEVICE_IN_HDMI |
public static final int | DEVICE_IN_VOICE_CALL |
public static final int | DEVICE_IN_TELEPHONY_RX |
public static final int | DEVICE_IN_BACK_MIC |
public static final int | DEVICE_IN_REMOTE_SUBMIX |
public static final int | DEVICE_IN_ANLG_DOCK_HEADSET |
public static final int | DEVICE_IN_DGTL_DOCK_HEADSET |
public static final int | DEVICE_IN_USB_ACCESSORY |
public static final int | DEVICE_IN_USB_DEVICE |
public static final int | DEVICE_IN_FM_TUNER |
public static final int | DEVICE_IN_TV_TUNER |
public static final int | DEVICE_IN_LINE |
public static final int | DEVICE_IN_SPDIF |
public static final int | DEVICE_IN_BLUETOOTH_A2DP |
public static final int | DEVICE_IN_LOOPBACK |
public static final int | DEVICE_IN_DEFAULT |
public static final int | DEVICE_IN_ALL |
public static final int | DEVICE_IN_ALL_SCO |
public static final int | DEVICE_IN_ALL_USB |
public static final int | DEVICE_STATE_UNAVAILABLE |
public static final int | DEVICE_STATE_AVAILABLE |
private static final int | NUM_DEVICE_STATES |
public static final String | DEVICE_OUT_EARPIECE_NAME |
public static final String | DEVICE_OUT_SPEAKER_NAME |
public static final String | DEVICE_OUT_WIRED_HEADSET_NAME |
public static final String | DEVICE_OUT_WIRED_HEADPHONE_NAME |
public static final String | DEVICE_OUT_BLUETOOTH_SCO_NAME |
public static final String | DEVICE_OUT_BLUETOOTH_SCO_HEADSET_NAME |
public static final String | DEVICE_OUT_BLUETOOTH_SCO_CARKIT_NAME |
public static final String | DEVICE_OUT_BLUETOOTH_A2DP_NAME |
public static final String | DEVICE_OUT_BLUETOOTH_A2DP_HEADPHONES_NAME |
public static final String | DEVICE_OUT_BLUETOOTH_A2DP_SPEAKER_NAME |
public static final String | DEVICE_OUT_AUX_DIGITAL_NAME |
public static final String | DEVICE_OUT_HDMI_NAME |
public static final String | DEVICE_OUT_ANLG_DOCK_HEADSET_NAME |
public static final String | DEVICE_OUT_DGTL_DOCK_HEADSET_NAME |
public static final String | DEVICE_OUT_USB_ACCESSORY_NAME |
public static final String | DEVICE_OUT_USB_DEVICE_NAME |
public static final String | DEVICE_OUT_REMOTE_SUBMIX_NAME |
public static final String | DEVICE_OUT_TELEPHONY_TX_NAME |
public static final String | DEVICE_OUT_LINE_NAME |
public static final String | DEVICE_OUT_HDMI_ARC_NAME |
public static final String | DEVICE_OUT_SPDIF_NAME |
public static final String | DEVICE_OUT_FM_NAME |
public static final String | DEVICE_OUT_AUX_LINE_NAME |
public static final String | DEVICE_OUT_SPEAKER_SAFE_NAME |
public static final String | DEVICE_IN_COMMUNICATION_NAME |
public static final String | DEVICE_IN_AMBIENT_NAME |
public static final String | DEVICE_IN_BUILTIN_MIC_NAME |
public static final String | DEVICE_IN_BLUETOOTH_SCO_HEADSET_NAME |
public static final String | DEVICE_IN_WIRED_HEADSET_NAME |
public static final String | DEVICE_IN_AUX_DIGITAL_NAME |
public static final String | DEVICE_IN_TELEPHONY_RX_NAME |
public static final String | DEVICE_IN_BACK_MIC_NAME |
public static final String | DEVICE_IN_REMOTE_SUBMIX_NAME |
public static final String | DEVICE_IN_ANLG_DOCK_HEADSET_NAME |
public static final String | DEVICE_IN_DGTL_DOCK_HEADSET_NAME |
public static final String | DEVICE_IN_USB_ACCESSORY_NAME |
public static final String | DEVICE_IN_USB_DEVICE_NAME |
public static final String | DEVICE_IN_FM_TUNER_NAME |
public static final String | DEVICE_IN_TV_TUNER_NAME |
public static final String | DEVICE_IN_LINE_NAME |
public static final String | DEVICE_IN_SPDIF_NAME |
public static final String | DEVICE_IN_BLUETOOTH_A2DP_NAME |
public static final String | DEVICE_IN_LOOPBACK_NAME |
public static final int | PHONE_STATE_OFFCALL |
public static final int | PHONE_STATE_RINGING |
public static final int | PHONE_STATE_INCALL |
public static final int | FORCE_NONE |
public static final int | FORCE_SPEAKER |
public static final int | FORCE_HEADPHONES |
public static final int | FORCE_BT_SCO |
public static final int | FORCE_BT_A2DP |
public static final int | FORCE_WIRED_ACCESSORY |
public static final int | FORCE_BT_CAR_DOCK |
public static final int | FORCE_BT_DESK_DOCK |
public static final int | FORCE_ANALOG_DOCK |
public static final int | FORCE_DIGITAL_DOCK |
public static final int | FORCE_NO_BT_A2DP |
public static final int | FORCE_SYSTEM_ENFORCED |
public static final int | FORCE_HDMI_SYSTEM_AUDIO_ENFORCED |
private static final int | NUM_FORCE_CONFIG |
public static final int | FORCE_DEFAULT |
public static final int | FOR_COMMUNICATION |
public static final int | FOR_MEDIA |
public static final int | FOR_RECORD |
public static final int | FOR_DOCK |
public static final int | FOR_SYSTEM |
public static final int | FOR_HDMI_SYSTEM_AUDIO |
private static final int | NUM_FORCE_USE |
public static final int | SYNC_EVENT_NONE |
public static final int | SYNC_EVENT_PRESENTATION_COMPLETE |
public static final int | AUDIO_HW_SYNC_INVALID |
Methods Summary |
---|
public static native int | checkAudioFlinger()
|
public static native int | createAudioPatch(AudioPatch[] patch, AudioPortConfig[] sources, AudioPortConfig[] sinks)
|
private static void | errorCallbackFromNative(int error)
ErrorCallback errorCallback = null;
synchronized (AudioSystem.class) {
if (mErrorCallback != null) {
errorCallback = mErrorCallback;
}
}
if (errorCallback != null) {
errorCallback.onError(error);
}
|
public static native int | getAudioHwSyncForSession(int sessionId)
|
public static native int | getDeviceConnectionState(int device, java.lang.String device_address)
|
public static native int | getDevicesForStream(int stream)
|
public static native int | getForceUse(int usage)
|
public static java.lang.String | getInputDeviceName(int device)
switch(device) {
case DEVICE_IN_COMMUNICATION:
return DEVICE_IN_COMMUNICATION_NAME;
case DEVICE_IN_AMBIENT:
return DEVICE_IN_AMBIENT_NAME;
case DEVICE_IN_BUILTIN_MIC:
return DEVICE_IN_BUILTIN_MIC_NAME;
case DEVICE_IN_BLUETOOTH_SCO_HEADSET:
return DEVICE_IN_BLUETOOTH_SCO_HEADSET_NAME;
case DEVICE_IN_WIRED_HEADSET:
return DEVICE_IN_WIRED_HEADSET_NAME;
case DEVICE_IN_AUX_DIGITAL:
return DEVICE_IN_AUX_DIGITAL_NAME;
case DEVICE_IN_TELEPHONY_RX:
return DEVICE_IN_TELEPHONY_RX_NAME;
case DEVICE_IN_BACK_MIC:
return DEVICE_IN_BACK_MIC_NAME;
case DEVICE_IN_REMOTE_SUBMIX:
return DEVICE_IN_REMOTE_SUBMIX_NAME;
case DEVICE_IN_ANLG_DOCK_HEADSET:
return DEVICE_IN_ANLG_DOCK_HEADSET_NAME;
case DEVICE_IN_DGTL_DOCK_HEADSET:
return DEVICE_IN_DGTL_DOCK_HEADSET_NAME;
case DEVICE_IN_USB_ACCESSORY:
return DEVICE_IN_USB_ACCESSORY_NAME;
case DEVICE_IN_USB_DEVICE:
return DEVICE_IN_USB_DEVICE_NAME;
case DEVICE_IN_FM_TUNER:
return DEVICE_IN_FM_TUNER_NAME;
case DEVICE_IN_TV_TUNER:
return DEVICE_IN_TV_TUNER_NAME;
case DEVICE_IN_LINE:
return DEVICE_IN_LINE_NAME;
case DEVICE_IN_SPDIF:
return DEVICE_IN_SPDIF_NAME;
case DEVICE_IN_BLUETOOTH_A2DP:
return DEVICE_IN_BLUETOOTH_A2DP_NAME;
case DEVICE_IN_LOOPBACK:
return DEVICE_IN_LOOPBACK_NAME;
case DEVICE_IN_DEFAULT:
default:
return Integer.toString(device);
}
|
public static native boolean | getMasterMute()
|
public static native float | getMasterVolume()
|
public static final int | getNumStreamTypes()
return NUM_STREAM_TYPES;
|
public static java.lang.String | getOutputDeviceName(int device)
switch(device) {
case DEVICE_OUT_EARPIECE:
return DEVICE_OUT_EARPIECE_NAME;
case DEVICE_OUT_SPEAKER:
return DEVICE_OUT_SPEAKER_NAME;
case DEVICE_OUT_WIRED_HEADSET:
return DEVICE_OUT_WIRED_HEADSET_NAME;
case DEVICE_OUT_WIRED_HEADPHONE:
return DEVICE_OUT_WIRED_HEADPHONE_NAME;
case DEVICE_OUT_BLUETOOTH_SCO:
return DEVICE_OUT_BLUETOOTH_SCO_NAME;
case DEVICE_OUT_BLUETOOTH_SCO_HEADSET:
return DEVICE_OUT_BLUETOOTH_SCO_HEADSET_NAME;
case DEVICE_OUT_BLUETOOTH_SCO_CARKIT:
return DEVICE_OUT_BLUETOOTH_SCO_CARKIT_NAME;
case DEVICE_OUT_BLUETOOTH_A2DP:
return DEVICE_OUT_BLUETOOTH_A2DP_NAME;
case DEVICE_OUT_BLUETOOTH_A2DP_HEADPHONES:
return DEVICE_OUT_BLUETOOTH_A2DP_HEADPHONES_NAME;
case DEVICE_OUT_BLUETOOTH_A2DP_SPEAKER:
return DEVICE_OUT_BLUETOOTH_A2DP_SPEAKER_NAME;
case DEVICE_OUT_HDMI:
return DEVICE_OUT_HDMI_NAME;
case DEVICE_OUT_ANLG_DOCK_HEADSET:
return DEVICE_OUT_ANLG_DOCK_HEADSET_NAME;
case DEVICE_OUT_DGTL_DOCK_HEADSET:
return DEVICE_OUT_DGTL_DOCK_HEADSET_NAME;
case DEVICE_OUT_USB_ACCESSORY:
return DEVICE_OUT_USB_ACCESSORY_NAME;
case DEVICE_OUT_USB_DEVICE:
return DEVICE_OUT_USB_DEVICE_NAME;
case DEVICE_OUT_REMOTE_SUBMIX:
return DEVICE_OUT_REMOTE_SUBMIX_NAME;
case DEVICE_OUT_TELEPHONY_TX:
return DEVICE_OUT_TELEPHONY_TX_NAME;
case DEVICE_OUT_LINE:
return DEVICE_OUT_LINE_NAME;
case DEVICE_OUT_HDMI_ARC:
return DEVICE_OUT_HDMI_ARC_NAME;
case DEVICE_OUT_SPDIF:
return DEVICE_OUT_SPDIF_NAME;
case DEVICE_OUT_FM:
return DEVICE_OUT_FM_NAME;
case DEVICE_OUT_AUX_LINE:
return DEVICE_OUT_AUX_LINE_NAME;
case DEVICE_OUT_SPEAKER_SAFE:
return DEVICE_OUT_SPEAKER_SAFE_NAME;
case DEVICE_OUT_DEFAULT:
default:
return Integer.toString(device);
}
|
public static native int | getOutputLatency(int stream)
|
public static native java.lang.String | getParameters(java.lang.String keys)
|
public static native int | getPrimaryOutputFrameCount()
|
public static native int | getPrimaryOutputSamplingRate()
|
public static native int | getStreamVolumeIndex(int stream, int device)
|
public static native int | initStreamVolume(int stream, int indexMin, int indexMax)
|
public static native boolean | isMicrophoneMuted()
|
public static native boolean | isSourceActive(int source)
|
public static native boolean | isStreamActive(int stream, int inPastMs)
|
public static native boolean | isStreamActiveRemotely(int stream, int inPastMs)
|
public static native int | listAudioPatches(java.util.ArrayList patches, int[] generation)
|
public static native int | listAudioPorts(java.util.ArrayList ports, int[] generation)
|
public static native int | muteMicrophone(boolean on)
|
public static native int | newAudioSessionId()
|
public static native int | registerPolicyMixes(java.util.ArrayList mixes, boolean register)
|
public static native int | releaseAudioPatch(AudioPatch patch)
|
public static native int | setAudioPortConfig(AudioPortConfig config)
|
public static native int | setDeviceConnectionState(int device, int state, java.lang.String device_address)
|
public static void | setErrorCallback(android.media.AudioSystem$ErrorCallback cb)
/*
* Handles the audio error callback.
*/
/*
* Callback for audio server errors.
* param error error code:
* - AUDIO_STATUS_OK
* - AUDIO_STATUS_SERVER_DIED
* - AUDIO_STATUS_ERROR
*/
/*
* Registers a callback to be invoked when an error occurs.
* @param cb the callback to run
*/
synchronized (AudioSystem.class) {
mErrorCallback = cb;
if (cb != null) {
cb.onError(checkAudioFlinger());
}
}
|
public static native int | setForceUse(int usage, int config)
|
public static native int | setLowRamDevice(boolean isLowRamDevice)
|
public static native int | setMasterMute(boolean mute)
|
public static native int | setMasterVolume(float value)
|
public static native int | setParameters(java.lang.String keyValuePairs)
|
public static native int | setPhoneState(int state)
|
public static native int | setStreamVolumeIndex(int stream, int index, int device)
|