Interface AudioDevice


public interface AudioDevice
Object holding audio device information.

It contains the name of the device, it's type if available (Earpiece, Speaker,
Bluetooth, etc..) and capabilities (input, output or both) the name of the
driver that created it (filter in mediastreamer).
You can use the AudioDevice objects to configure default input/output
devices or do it dynamically during a call.
To get the list of available devices, use Core.getAudioDevices(). This
list will be limited to one device of each type. Use Core.getExtendedAudioDevices()
for a complete list.
  • Method Details

    • getCapabilities

      AudioDevice.Capabilities getCapabilities()
      Returns the capabilities of the device.

      Returns:
      the AudioDevice.Capabilities of the audio device (RECORD, PLAY or both) as
      a bit mask
    • getDeviceName

      @NonNull String getDeviceName()
      Returns the name of the audio device.

      Returns:
      the name of the audio device.
    • getDriverName

      @NonNull String getDriverName()
      Returns the driver name used by the device.

      Returns:
      the name of the driver used by this audio device.
    • getFollowsSystemRoutingPolicy

      boolean getFollowsSystemRoutingPolicy()
      Returns whether the audio device automatically follows the system's audio
      routing policy.

      This capability is available on some system (typically iOS) and might be
      convenient to simply specify liblinphone to let the system decide about which
      audio route is being used to handle a call. The actual AudioDevice.Type may be
      unknown at some point, typically when no calls are running, otherwise it is
      reflected to be the actual system's audio route.
      Returns:
      true if the audio device automatically follows the system audio routing
      policy.
    • getId

      @NonNull String getId()
      Returns the id of the audio device.

      Returns:
      the id of the audio device.
    • getType

      AudioDevice.Type getType()
      Returns the type of the device.

      Returns:
      the AudioDevice.Type of the audio device (microphone, speaker, earpiece,
      bluetooth, etc...)
    • hasCapability

      boolean hasCapability(AudioDevice.Capabilities capability)
      Returns whether or not the audio device has the given capability.

      Parameters:
      capability - the AudioDevice.Capabilities to check
      Returns:
      true if the audio device has the capability, false otherwise
    • setUserData

      void setUserData(Object data)
      Sets the object to store in this object user's data
      Parameters:
      data - the object to store
    • getUserData

      Object getUserData()
      Gets the object stored in this object user's data
      Returns:
      the object store if any, null otherwise
    • getNativePointer

      long getNativePointer()
      Gets the native pointer used by this class to make native method calls.
      Returns:
      the nativer pointer, as long
    • toString

      String toString()
      Overrides:
      toString in class Object