Interface AudioDeviceModule

All Known Implementing Classes:
JavaAudioDeviceModule

public interface AudioDeviceModule
This interface is a thin wrapper on top of a native C++ webrtc::AudioDeviceModule (ADM). The reason for basing it on a native ADM instead of a pure Java interface is that we have two native Android implementations (OpenSLES and AAudio) that does not make sense to wrap through JNI.

Note: This class is still under development and may change without notice.

  • Method Summary

    Modifier and Type
    Method
    Description
    long
    Returns a C++ pointer to a webrtc::AudioDeviceModule.
    void
    Release resources for this AudioDeviceModule, including native resources.
    void
    setMicrophoneMute(boolean mute)
    Control muting/unmuting the microphone.
    default boolean
    setNoiseSuppressorEnabled(boolean enabled)
    Enable or disable built in noise suppressor.
    default boolean
    Sets the preferred field dimension for the built-in microphone.
    void
    setSpeakerMute(boolean mute)
    Control muting/unmuting the speaker.
  • Method Details

    • getNativeAudioDeviceModulePointer

      long getNativeAudioDeviceModulePointer()
      Returns a C++ pointer to a webrtc::AudioDeviceModule. Caller does _not_ take ownership and lifetime is handled through the release() call.
    • release

      void release()
      Release resources for this AudioDeviceModule, including native resources. The object should not be used after this call.
    • setSpeakerMute

      void setSpeakerMute(boolean mute)
      Control muting/unmuting the speaker.
    • setMicrophoneMute

      void setMicrophoneMute(boolean mute)
      Control muting/unmuting the microphone.
    • setNoiseSuppressorEnabled

      default boolean setNoiseSuppressorEnabled(boolean enabled)
      Enable or disable built in noise suppressor. Returns true if the enabling was successful, otherwise false is returned.
    • setPreferredMicrophoneFieldDimension

      default boolean setPreferredMicrophoneFieldDimension(float dimension)
      Sets the preferred field dimension for the built-in microphone. Returns true if setting was successful, otherwise false is returned. This functionality can be implemented with android.media.MicrophoneDirection.setPreferredMicrophoneFieldDimension.