API reference
API reference
Select your platform
No SDKs available
No versions available

BaseSpeechService Class

Extends MonoBehaviour
A simple base class for wrapping VoiceServiceRequest event callbacks

Fields

Whether this script should wrap all request event setups
Whether this script should log
Returns true if this voice service is currently active, listening with the mic or performing a networked request

Properties

All currently running requests
Returns true if this voice service is currently active, listening with the mic or performing a networked request

Protected Functions

If applicable, get all speech events
Get the first running audio request
On enable, begin watching for request initialized callbacks
On enable, stop watching for request initialized callbacks
virtual void Log
( VoiceServiceRequest request,
string log,
bool warn )
virtual void OnRequestInit
( VoiceServiceRequest request )
virtual void OnRequestStartListening
( VoiceServiceRequest request )
virtual void OnRequestStopListening
( VoiceServiceRequest request )
virtual void OnRequestSend
( VoiceServiceRequest request )
virtual void OnRequestRawResponse
( VoiceServiceRequest request,
string rawResponse )
virtual void OnRequestPartialTranscription
( VoiceServiceRequest request )
virtual void OnRequestFullTranscription
( VoiceServiceRequest request )
virtual void OnRequestPartialResponse
( VoiceServiceRequest request )
virtual void OnRequestCancel
( VoiceServiceRequest request )
virtual void OnRequestFailed
( VoiceServiceRequest request )
virtual void OnRequestSuccess
( VoiceServiceRequest request )
virtual void OnRequestComplete
( VoiceServiceRequest request )
Adds or removes event listeners for every request event callback
Parameters
request
The request to begin or stop listening to
addListeners
If true, adds listeners and if false, removes listeners.

Member Functions

Check for error that will occur if attempting to activate audio
Returns
Returns an error audio activation should not be allowed.
Whether an audio request can be started or not
Check for error that will occur if attempting to send data
Returns
Returns an error if send will not be allowed.
Whether a voice service request can be sent or not
Deactivate all requests
Deactivate a specific request
Deactivate and abort all requests
Deactivate and abort a specific requests
Method to setup request events with provided base events
Parameters
events
Generate request events if empty
Accepts a generated voice service request, wraps all request events & returns local methods for each
Parameters
request
The provided VoiceServiceRequest to be tracked
Returns
Returns false if wrap fails
Did you find this page helpful?
Thumbs up icon
Thumbs down icon