Package org.openhab.core.voice
Interface KSEdgeService
- All Superinterfaces:
KSService
This is the interface that an edge keyword spotting service has to implement.
Used to register a keyword spotting service that is running on a remote device.
- Author:
- Miguel Álvarez - Initial contribution
-
Method Summary
Modifier and TypeMethodDescriptionspot(KSListener ksListener) This method links the remote keyword spotting process to a consumer.default KSServiceHandlespot(KSListener ksListener, AudioStream audioStream, Locale locale, String keyword) This method starts the process of keyword spotting The audio data of the passedAudioStreamis passed to the keyword spotting engine.Methods inherited from interface org.openhab.core.voice.KSService
getId, getLabel, getSupportedFormats, getSupportedLocales
-
Method Details
-
spot
This method links the remote keyword spotting process to a consumer. The method is supposed to return fast.- Parameters:
ksListener- Non-nullKSListenerthatKSEventevents target- Throws:
KSException- if any parameter is invalid or a problem occurs
-
spot
default KSServiceHandle spot(KSListener ksListener, AudioStream audioStream, Locale locale, String keyword) throws KSException Description copied from interface:KSServiceThis method starts the process of keyword spotting The audio data of the passedAudioStreamis passed to the keyword spotting engine. The keyword spotting attempts to spotkeywordas being spoken in the passedLocale. Spotted keyword is indicated by firedKSEventevents targeting the passedKSListener. The passedAudioStreammust be of a supportedAudioFormat. In other words anAudioFormatcompatible with one returned from thegetSupportedFormats()method. The passedLocalemust be supported. That is to say it must be aLocalereturned from thegetSupportedLocales()method. The passedkeywordis the keyword which should be spotted. The method is supposed to return fast, i.e. it should only start the spotting as a background process.- Specified by:
spotin interfaceKSService- Parameters:
ksListener- Non-nullKSListenerthatKSEventevents targetaudioStream- TheAudioStreamfrom which keywords are spottedlocale- TheLocalein which the target keywords are spokenkeyword- The keyword which to spot- Returns:
- A
KSServiceHandleused to abort keyword spotting - Throws:
KSException- if any parameter is invalid or a problem occurs
-