RealtimeControllerFacade

@objc
public protocol RealtimeControllerFacade

RealtimeControllerFacade controls aspects meetings concerning realtime UX that for performance, privacy, or other reasons should be implemented using the most direct path. Callbacks generated by this interface should be consumed synchronously and without business logic dependent on the UI state where possible.

Events will be passed through RealtimeObserver, which in turn provides consumers the volume/mute/signal/attendee callbacks that can be used to render in the UI.

  • Mutes the audio input.

    Declaration

    Swift

    func realtimeLocalMute() -> Bool

    Return Value

    Whether mute was successful

  • Unmutes the audio input if currently allowed

    Declaration

    Swift

    func realtimeLocalUnmute() -> Bool

    Return Value

    Whether unmute was successful

  • Subscribes to real time events with an observer

    Declaration

    Swift

    func addRealtimeObserver(observer: RealtimeObserver)

    Parameters

    observer

    Observer that handles real time events

  • Unsubscribes from real time events by removing the specified observer

    Declaration

    Swift

    func removeRealtimeObserver(observer: RealtimeObserver)

    Parameters

    observer

    Observer that handles real time events

  • Subscribes to data meesage event with an observer

    Declaration

    Swift

    func addRealtimeDataMessageObserver(topic: String, observer: DataMessageObserver)

    Parameters

    topic

    Topic to handle

    observer

    Observer that handles data message event with given topic

  • Unsubscribes from data meesage event by removing the specified observer by topic

    Declaration

    Swift

    func removeRealtimeDataMessageObserverFromTopic(topic: String)

    Parameters

    topic

    Topic to remove

  • Send arbitrary data to given topic with given lifetime ms (5 mins max)

    Throws

    SendDataMessageError

    Declaration

    Swift

    func realtimeSendDataMessage(topic: String, data: Any, lifetimeMs: Int32) throws

    Parameters

    topic

    Topic to send

    data

    Data to send, data can be a String, a ByteArray, or a JSON serializable object

    lifetimeMs

    Message lifetime in milisecond, 5 mins max, default 0

  • Enable or disable Amazon Voice Focus (ML-based noise suppression) on the audio input

    Note: Only call this API after audioClient starts. Calling it before that results in a no-op. Amazon Voice Focus is disabled by default when audioClient starts.

    Declaration

    Swift

    func realtimeSetVoiceFocusEnabled(enabled: Bool) -> Bool

    Parameters

    enabled

    A Bool value, where true to enable; false to disable

    Return Value

    Whether the enable/disable action was successful

  • Check if Amazon Voice Focus (ML-based noise suppression) is enabled or not

    Declaration

    Swift

    func realtimeIsVoiceFocusEnabled() -> Bool

    Return Value

    true if Amazon Voice Focus is enabled; false if Amazon Voice Focus is not enabled, or the audio session was not started yet

  • Subscribe to live transcription events with an observer

    Declaration

    Swift

    @objc
    optional func addRealtimeTranscriptEventObserver(observer: TranscriptEventObserver)

    Parameters

    observer

    Observer that handles live transcription events

  • Unsubscribes from live transcription events by removing the specified observer

    Declaration

    Swift

    @objc
    optional func removeRealtimeTranscriptEventObserver(observer: TranscriptEventObserver)

    Parameters

    observer

    Observer that handles live transcription events