Package tvi.webrtc.audio
Class JavaAudioDeviceModule
- java.lang.Object
-
- tvi.webrtc.audio.JavaAudioDeviceModule
-
- All Implemented Interfaces:
AudioDeviceModule
public class JavaAudioDeviceModule extends java.lang.Object implements AudioDeviceModule
AudioDeviceModule implemented using android.media.AudioRecord as input and android.media.AudioTrack as output.
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static interface
JavaAudioDeviceModule.AudioRecordErrorCallback
static class
JavaAudioDeviceModule.AudioRecordStartErrorCode
static interface
JavaAudioDeviceModule.AudioRecordStateCallback
Called when audio recording starts and stops.static class
JavaAudioDeviceModule.AudioSamples
Contains audio sample information.static interface
JavaAudioDeviceModule.AudioTrackErrorCallback
static class
JavaAudioDeviceModule.AudioTrackStartErrorCode
static interface
JavaAudioDeviceModule.AudioTrackStateCallback
Called when audio playout starts and stops.static class
JavaAudioDeviceModule.Builder
static interface
JavaAudioDeviceModule.SamplesReadyCallback
Called when new audio samples are ready.
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description static JavaAudioDeviceModule.Builder
builder(android.content.Context context)
long
getNativeAudioDeviceModulePointer()
Returns a C++ pointer to a webrtc::AudioDeviceModule.static boolean
isBuiltInAcousticEchoCancelerSupported()
Returns true if the device supports built-in HW AEC, and the UUID is approved (some UUIDs can be excluded).static boolean
isBuiltInNoiseSuppressorSupported()
Returns true if the device supports built-in HW NS, and the UUID is approved (some UUIDs can be excluded).void
release()
Release resources for this AudioDeviceModule, including native resources.void
setMicrophoneMute(boolean mute)
Control muting/unmuting the microphone.void
setPreferredInputDevice(android.media.AudioDeviceInfo preferredInputDevice)
Start to prefer a specificAudioDeviceInfo
device for recording.void
setSpeakerMute(boolean mute)
Control muting/unmuting the speaker.
-
-
-
Method Detail
-
builder
public static JavaAudioDeviceModule.Builder builder(android.content.Context context)
-
isBuiltInAcousticEchoCancelerSupported
public static boolean isBuiltInAcousticEchoCancelerSupported()
Returns true if the device supports built-in HW AEC, and the UUID is approved (some UUIDs can be excluded).
-
isBuiltInNoiseSuppressorSupported
public static boolean isBuiltInNoiseSuppressorSupported()
Returns true if the device supports built-in HW NS, and the UUID is approved (some UUIDs can be excluded).
-
getNativeAudioDeviceModulePointer
public long getNativeAudioDeviceModulePointer()
Description copied from interface:AudioDeviceModule
Returns a C++ pointer to a webrtc::AudioDeviceModule. Caller does _not_ take ownership and lifetime is handled through the release() call.- Specified by:
getNativeAudioDeviceModulePointer
in interfaceAudioDeviceModule
-
release
public void release()
Description copied from interface:AudioDeviceModule
Release resources for this AudioDeviceModule, including native resources. The object should not be used after this call.- Specified by:
release
in interfaceAudioDeviceModule
-
setSpeakerMute
public void setSpeakerMute(boolean mute)
Description copied from interface:AudioDeviceModule
Control muting/unmuting the speaker.- Specified by:
setSpeakerMute
in interfaceAudioDeviceModule
-
setMicrophoneMute
public void setMicrophoneMute(boolean mute)
Description copied from interface:AudioDeviceModule
Control muting/unmuting the microphone.- Specified by:
setMicrophoneMute
in interfaceAudioDeviceModule
-
setPreferredInputDevice
public void setPreferredInputDevice(android.media.AudioDeviceInfo preferredInputDevice)
Start to prefer a specificAudioDeviceInfo
device for recording. Typically this should only be used if a client gives an explicit option for choosing a physical device to record from. Otherwise the best-matching device for other parameters will be used. Calling after recording is started may cause a temporary interruption if the audio routing changes.
-
-