Package com.amazonaws.ivs.broadcast
Class StageAudioManager
java.lang.Object
com.amazonaws.ivs.broadcast.StageAudioManager
Manages audio settings for all stages.
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic enum
static enum
static enum
static enum
-
Method Summary
Modifier and TypeMethodDescriptionvoid
enableEchoCancellation
(boolean isEnabled) Enable or disable echo cancellation.static StageAudioManager
getInstance
(android.content.Context context) Returns an instance of the StageAudioManager.getUsage()
boolean
Whether echo cancellation is currently enabled.void
setAudioModeManagementEnabled
(boolean isEnabled) Use this method to turn off the audio mode management (including for Bluetooth) done by the IVS SDK if your application wants to manage this itself.void
setConfiguration
(StageAudioManager.Source source, StageAudioManager.ContentType contentType, StageAudioManager.Usage usage) void
-
Method Details
-
setAudioModeManagementEnabled
public void setAudioModeManagementEnabled(boolean isEnabled) Use this method to turn off the audio mode management (including for Bluetooth) done by the IVS SDK if your application wants to manage this itself. Please see AudioManager#setMode in the Android SDK.You can still use the various presets and the source / usage / content type values which affect AAudio stream attributes, and are important for things like echo cancellation.
- Parameters:
isEnabled
- Whether the audio mode management done by this class is enabled, the default is true.
-
enableEchoCancellation
public void enableEchoCancellation(boolean isEnabled) Enable or disable echo cancellation. This can only be set if there are no unreleased instances of Stage or DeviceDiscovery.With this enabled, the SDK will use platform echo cancellation if available for best performance, but fall back to software echo cancellation if platform echo cancellation is not available or the device model is known to provide poor echo cancellation.
Using the STUDIO or SUBSCRIBE_ONLY audio mode presets will disable echo cancellation. Enabling echo cancellation via this method after setting the STUDIO or SUBSCRIBE_ONLY preset will override the STUDIO or SUBSCRIBE_ONLY preset.
- Parameters:
isEnabled
- Whether echo cancellation is enabled, the default is true.
-
isEchoCancellationEnabled
public boolean isEchoCancellationEnabled()Whether echo cancellation is currently enabled. -
setPreset
- Throws:
IllegalStateException
-
setConfiguration
public void setConfiguration(@NonNull StageAudioManager.Source source, @NonNull StageAudioManager.ContentType contentType, @NonNull StageAudioManager.Usage usage) throws IllegalStateException - Throws:
IllegalStateException
-
getSource
-
getContentType
-
getUsage
-
getInstance
Returns an instance of the StageAudioManager.- Parameters:
context
- The current application context- Returns:
- the instance of the StageAudioManager
-