Skip to content

Latest commit

 

History

History
65 lines (40 loc) · 1.32 KB

SpeechlyProtocol.md

File metadata and controls

65 lines (40 loc) · 1.32 KB

SpeechlyProtocol

A speech client protocol.

public protocol SpeechlyProtocol

The purpose of a speech client is to abstract away the handling of audio recording and API streaming, providing the user with a high-level abstraction over the microphone speech recognition.

Requirements

delegate

A delegate which is called when the client has received and parsed messages from the API. The delegate will also be called when the client catches an error.

var delegate: SpeechlyDelegate?

startContext(appId:​)

Start a new recognition context and unmute the microphone.

func startContext(appId: String?)

Parameters

  • appId: Define a specific Speechly appId to send the audio to. Not needed if the appId can be inferred from login.

stopContext()

Stop current recognition context and mute the microphone.

func stopContext()

suspend()

Suspend the client, releasing any resources and cleaning up any pending contexts.

func suspend()

This method should be used when your application is about to enter background state.

resume()

Resume the client, re-initialing necessary resources to continue the operation.

func resume() throws

This method should be used when your application is about to leave background state.