Package com.sinch.android.rtc
Interface AudioController
-
public interface AudioController
Interface for controlling different audio settings. AnAudioController
object is only valid while theSinchClient
is started. As soon as theSinchClient
is stopped, this object is invalidated and must not be used. Please seeenableAutomaticAudioRouting(com.sinch.android.rtc.AudioController.AudioRoutingConfig)
for advanced automatic audio routing options.
-
-
Nested Class Summary
Nested Classes Modifier and Type Interface Description static class
AudioController.AudioRoutingConfig
Automatic routing configuration data.static class
AudioController.UseSpeakerphone
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description void
disableAutomaticAudioRouting()
Disables automatic audio routing (AAR).void
disableSpeaker()
Disables speaker mode.void
enableAutomaticAudioRouting(AudioController.AudioRoutingConfig audioRoutingConfig)
Enables automatic audio routing between earpiece, speakerphone, wired headset and bluetooth audio devices.void
enableSpeaker()
Enables speaker mode.boolean
isAutomaticAudioRoutingEnabled()
Checks whether the automatic audio routing is enabled.boolean
isMute()
Checks whether the microphone is muted.boolean
isSpeakerOn()
Checks whether the speaker is enabled.void
mute()
Mutes audio input.void
setLocalAudioListener(LocalAudioListener listener)
Sets a listener for the local audio listener.void
unmute()
Unmutes audio input.
-
-
-
Method Detail
-
mute
void mute()
Mutes audio input.
-
unmute
void unmute()
Unmutes audio input.
-
isMute
boolean isMute()
Checks whether the microphone is muted.- Returns:
- true if microphone is muted, false otherwise.
-
enableSpeaker
void enableSpeaker()
Enables speaker mode.
-
disableSpeaker
void disableSpeaker()
Disables speaker mode.
-
isSpeakerOn
boolean isSpeakerOn()
Checks whether the speaker is enabled.- Returns:
- true if speaker is enabled, false otherwise.
-
setLocalAudioListener
void setLocalAudioListener(LocalAudioListener listener)
Sets a listener for the local audio listener.- Parameters:
listener
- will be called when the recording is being started, stopped and when new audio buffer is available.- See Also:
LocalAudioListener
-
enableAutomaticAudioRouting
void enableAutomaticAudioRouting(AudioController.AudioRoutingConfig audioRoutingConfig)
Enables automatic audio routing between earpiece, speakerphone, wired headset and bluetooth audio devices.
Priorities are following:- Bluetooth (if available and manageBluetoothAudio == true)
- Wired Headset
- Default audio device if
useSpeakerphone
is TRUE or FALSE, or Proximity sensor's based decision (speakerphone / earpiece) ifuseSpeakerphone
is AUTO.
useSpeakerphone
parameter. ThrowsMissingPermissionException
if manageBluetoothAudio is set to true and android.Manifest.permission.BLUETOOTH is not granted.- Parameters:
audioRoutingConfig
- automatic routing configuration data- See Also:
AudioController.AudioRoutingConfig
-
disableAutomaticAudioRouting
void disableAutomaticAudioRouting()
Disables automatic audio routing (AAR). When AAR is disabled use AudioController enableSpeaker()/disableSpeaker() to toggle between speakerphone and earpiece.
-
isAutomaticAudioRoutingEnabled
boolean isAutomaticAudioRoutingEnabled()
Checks whether the automatic audio routing is enabled.- Returns:
- true if automatic routing is enabled, false otherwise.
-
-