ClientHelperInterface

interface ClientHelperInterface

This is an utility interface that gathers simplified APIs in one place and provides them to clients.

Functions

Link copied to clipboard
abstract fun addASRListener(listener: ASRAgentInterface.OnStateChangeListener)

Add listener to be called when there has been changes of ASRAgentInterface.State or DialogMode

Link copied to clipboard
abstract fun addASRResultListener(listener: ASRAgentInterface.OnResultListener)

add listener to be called when receive following events of STT

Link copied to clipboard
abstract fun addAudioPlayerListener(listener: AudioPlayerAgentInterface.Listener)

Add listener to be called when there has been an change of AudioPlayerAgentInterface.Listener

Link copied to clipboard
abstract fun addConnectionListener(listener: ConnectionStatusListener)

Add listener to be notified when connection status changed for NUGU

Link copied to clipboard
abstract fun addDialogUXStateListener(listener: DialogUXStateAggregatorInterface.Listener)

Add listener to be called when there has been an change of DialogUXStateAggregatorInterface.DialogUXState

Link copied to clipboard

Add listener to be notified when occur event of directive handling.

Link copied to clipboard
abstract fun addOnSendMessageListener(listener: MessageSender.OnSendMessageListener)

Add listener to be notified when send message

Link copied to clipboard
abstract fun addReceiveDirectivesListener(listener: DirectiveGroupProcessorInterface.Listener)

Add listener to be notified when receive directives from NUGU platform

Link copied to clipboard
abstract fun addSpeakerListener(listener: SpeakerManagerObserver)

Add listener to be notified when speaker status changed

Link copied to clipboard
abstract fun addSystemAgentListener(listener: SystemAgentInterface.Listener)

Add listener to be notified when receive an event from the System Capability agent

Link copied to clipboard
abstract fun cancelTTSAndOthers()

Cancel playing tts and other directives which has same dialog request id.

Link copied to clipboard
abstract fun connect()

Connect to NUGU

Link copied to clipboard
abstract fun disconnect()

Disconnect from NUGU

Link copied to clipboard
abstract fun getDisplay(): DisplayAggregatorInterface?

Return DisplayAggregatorInterface to interact with the client display

Link copied to clipboard
abstract fun getPlaybackRouter(): PlaybackRouter

Return PlaybackRouter which send event to control audio player

Link copied to clipboard
abstract fun getSpeakerManager(): SpeakerManagerInterface?

Return SpeakerManagerInterface which can control volume & mute

Link copied to clipboard
abstract fun localStopTTS()

Stop current playing TTS

Link copied to clipboard
abstract fun removeASRListener(listener: ASRAgentInterface.OnStateChangeListener)

Remove listener

Link copied to clipboard
abstract fun removeASRResultListener(listener: ASRAgentInterface.OnResultListener)

remove event listener

Link copied to clipboard
abstract fun removeAudioPlayerListener(listener: AudioPlayerAgentInterface.Listener)

Remove listener

Link copied to clipboard
abstract fun removeConnectionListener(listener: ConnectionStatusListener)

Remove listener

Link copied to clipboard
abstract fun removeDialogUXStateListener(listener: DialogUXStateAggregatorInterface.Listener)

Remove listener

Link copied to clipboard

Remove listener

Link copied to clipboard
abstract fun removeOnSendMessageListener(listener: MessageSender.OnSendMessageListener)

Remove listener to be notified when send message

Link copied to clipboard
abstract fun removeReceiveDirectivesListener(listener: DirectiveGroupProcessorInterface.Listener)

Remove listener to be notified when receive directives from NUGU platform

Link copied to clipboard
abstract fun removeSpeakerListener(listener: SpeakerManagerObserver)

Remove listener

Link copied to clipboard
abstract fun removeSystemAgentListener(listener: SystemAgentInterface.Listener)

Remove listener

Link copied to clipboard
abstract fun requestTextInput(    text: String,     playServiceId: String? = null,     token: String? = null,     source: String? = null,     referrerDialogRequestId: String? = null,     includeDialogAttribute: Boolean = true,     listener: TextAgentInterface.RequestListener? = null): String?

Send request for NUGU with text input. The client receive the same response(directive) as when they requested ASR.

Link copied to clipboard
abstract fun requestTTS(    text: String,     format: TTSAgentInterface.Format = TTSAgentInterface.Format.TEXT,     playServiceId: String? = null,     listener: TTSAgentInterface.OnPlaybackListener? = null): String?

Send request for TTS response given text

Link copied to clipboard
abstract fun setDisplayRenderer(renderer: DisplayAggregatorInterface.Renderer?)

set renderer to interact with DisplayAggregatorInterface

Link copied to clipboard
abstract fun setStateProvider(namespaceAndName: NamespaceAndName, stateProvider: ContextStateProvider?)
Link copied to clipboard
abstract fun shutdown()

Shutdown client

Link copied to clipboard
abstract fun startRecognition(    audioInputStream: SharedDataStream?,     audioFormat: AudioFormat?,     wakeupInfo: WakeupInfo?,     param: EndPointDetectorParam?,     callback: ASRAgentInterface.StartRecognitionCallback?,     initiator: ASRAgentInterface.Initiator)

Start recognizing

Link copied to clipboard
abstract fun stopRecognition()

Stop current recognizing.