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 KSServiceHandle
spot
(KSListener ksListener, AudioStream audioStream, Locale locale, String keyword) This method starts the process of keyword spotting The audio data of the passedAudioStream
is 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-nullKSListener
thatKSEvent
events 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:KSService
This method starts the process of keyword spotting The audio data of the passedAudioStream
is passed to the keyword spotting engine. The keyword spotting attempts to spotkeyword
as being spoken in the passedLocale
. Spotted keyword is indicated by firedKSEvent
events targeting the passedKSListener
. The passedAudioStream
must be of a supportedAudioFormat
. In other words anAudioFormat
compatible with one returned from thegetSupportedFormats()
method. The passedLocale
must be supported. That is to say it must be aLocale
returned from thegetSupportedLocales()
method. The passedkeyword
is 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:
spot
in interfaceKSService
- Parameters:
ksListener
- Non-nullKSListener
thatKSEvent
events targetaudioStream
- TheAudioStream
from which keywords are spottedlocale
- TheLocale
in which the target keywords are spokenkeyword
- The keyword which to spot- Returns:
- A
KSServiceHandle
used to abort keyword spotting - Throws:
KSException
- if any parameter is invalid or a problem occurs
-