SpeechEventListener

public protocol SpeechEventListener : AnyObject

Classes which conform to this protocol will have access to a set of important callback methods on specific speech events.

  • A callback method triggered when a response is received from a speech server.

    Declaration

    Swift

    func onSpeechResponseReceived(data: String, final: Bool, requestId: String)

    Parameters

    data

    the response received from the speech server which contains the converted text or the error message.

    final

    true if the response is final, false otherwise (a partial response).

    requestId

    the speech request id used for speech analytics on the backend.

  • A callback method triggered when new audio buffer is received.

    Declaration

    Swift

    func onAudioReceived(audioBuffer: [Double])

    Parameters

    audioBuffer

    an array of type Double which returns the audio buffer values returned by the audio engine for each chunk of recorded voice.

  • A callback method triggered when speech server is connected or disconnected.

    Declaration

    Swift

    func onNetworkChanged(connectionStatus: ConnectionStatus)

    Parameters

    connectionStatus

    a ConnectionStatus object among .connecting, .connected, .disconnected.