public abstract class BaseAudioDevice
extends java.lang.Object
AudioDeviceManager.setAudioDevice(BaseAudioDevice device)
.Modifier and Type | Class and Description |
---|---|
static class |
BaseAudioDevice.AudioBus
The audio bus marshals audio data between the network and the audio
device.
|
static class |
BaseAudioDevice.AudioSettings
Defines the format of the audio when a custom audio driver is used.
|
static class |
BaseAudioDevice.BluetoothState
Defines values for the
getBluetoothState() method. |
static class |
BaseAudioDevice.OutputMode
Defines values for the
setOutputMode(OutputMode mode) method. |
Constructor and Description |
---|
BaseAudioDevice() |
Modifier and Type | Method and Description |
---|---|
abstract boolean |
destroyCapturer()
Stops the audio capturer thread.
|
abstract boolean |
destroyRenderer()
Stops the audio renderer thread.
|
protected void |
finalize() |
BaseAudioDevice.AudioBus |
getAudioBus()
Gets the AudioBus instance that this audio device uses.
|
BaseAudioDevice.BluetoothState |
getBluetoothState()
Returns
BaseAudioDevice.BluetoothState.Connected if there is a Bluetooth device and audio is being
rendered to this device. |
abstract BaseAudioDevice.AudioSettings |
getCaptureSettings()
Returns the AudioSettings object defining the audio capture settings used
by this device.
|
abstract int |
getEstimatedCaptureDelay()
The estimated capturing delay in ms.
|
abstract int |
getEstimatedRenderDelay()
Returns the estimated rendering delay in ms.
|
BaseAudioDevice.OutputMode |
getOutputMode()
Returns the audio output mode for the app.
|
abstract BaseAudioDevice.AudioSettings |
getRenderSettings()
Returns the AudioSettings object defining the audio rendering settings
used by this device.
|
abstract boolean |
initCapturer()
Requests the audio device to initialize itself for audio sampling.
|
abstract boolean |
initRenderer()
Requests the audio device to initialize itself for rendering.
|
abstract void |
onPause()
Call this method when the activity pauses.
|
abstract void |
onResume()
Call this method when the activity resumes.
|
boolean |
setOutputMode(BaseAudioDevice.OutputMode mode)
Set the audio output mode for the app: video (the default) or voice.
|
abstract boolean |
startCapturer()
Requests that the device start capturing audio samples.
|
abstract boolean |
startRenderer()
Requests that the device start rendering audio.
|
abstract boolean |
stopCapturer()
Requests that the device stop sampling audio.
|
abstract boolean |
stopRenderer()
Requests that the device stop rendering audio.
|
public abstract boolean initCapturer()
public abstract boolean startCapturer()
public abstract boolean stopCapturer()
public abstract boolean destroyCapturer()
public abstract boolean initRenderer()
public abstract boolean startRenderer()
public abstract boolean stopRenderer()
public abstract boolean destroyRenderer()
public abstract int getEstimatedCaptureDelay()
public abstract int getEstimatedRenderDelay()
public abstract BaseAudioDevice.AudioSettings getCaptureSettings()
BaseAudioDevice.AudioSettings
object.public abstract BaseAudioDevice.AudioSettings getRenderSettings()
BaseAudioDevice.AudioSettings
object.public abstract void onPause()
onResume()
public abstract void onResume()
onPause()
protected void finalize() throws java.lang.Throwable
finalize
in class java.lang.Object
java.lang.Throwable
public boolean setOutputMode(BaseAudioDevice.OutputMode mode)
OutputMode.SpeakerPhone
— Pass in this
value to set the audio output mode for video communication (the default
setting). When using the default audio driver, the app uses the device
loudspeaker instead of the headset speaker. This is preferable for apps
that include both video and audio.OutputMode.Handset
— Pass in this
value to set the audio output mode for voice communication. When using
the default audio driver, the app uses the headset speaker (and the
loudspeaker is disabled), so that the device can be used as in a regular
phone call. This is preferable in voice-only apps. When a Bluetooth device
is connected, this will send the audio to it instead of the Handset.Call this method before you connect to a session.
The following code sets the app to use handset audio output mode, which is preferred in a voice-only app:
AudioDeviceManager.getAudioDevice().setOutputMode(OutputMode.Handset);
mode
- The audio output mode for the app.public BaseAudioDevice.OutputMode getOutputMode()
setOutputMode(OutputMode mode)
public BaseAudioDevice.AudioBus getAudioBus()
public BaseAudioDevice.BluetoothState getBluetoothState()
BaseAudioDevice.BluetoothState.Connected
if there is a Bluetooth device and audio is being
rendered to this device. Returns BaseAudioDevice.BluetoothState.Disconnected
otherwise.