Class StageAudioManager

java.lang.Object
com.amazonaws.ivs.broadcast.StageAudioManager

@RequiresApi(api=28) public class StageAudioManager extends Object
Manages audio settings for all stages.
  • 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

      public void setPreset(@NonNull StageAudioManager.UseCasePreset preset) throws IllegalStateException
      Throws:
      IllegalStateException
    • setConfiguration

      public void setConfiguration(@NonNull StageAudioManager.Source source, @NonNull StageAudioManager.ContentType contentType, @NonNull StageAudioManager.Usage usage) throws IllegalStateException
      Throws:
      IllegalStateException
    • getSource

      @NonNull public StageAudioManager.Source getSource()
    • getContentType

      @NonNull public StageAudioManager.ContentType getContentType()
    • getUsage

      @NonNull public StageAudioManager.Usage getUsage()
    • getInstance

      public static StageAudioManager getInstance(@NonNull android.content.Context context)
      Returns an instance of the StageAudioManager.
      Parameters:
      context - The current application context
      Returns:
      the instance of the StageAudioManager