Interface KSService
- All Superinterfaces:
DTService
This is the interface that a keyword spotting service has to implement.
- Author:
- Kelly Davis - Initial contribution, Kai Kreuzer - Refactored to use AudioStream
-
Method Summary
Modifier and TypeMethodDescriptionGet the audio formats supported by this KSServiceGet the Locales available from this KSServicespot(KSListener ksListener, AudioStream audioStream, Locale locale, String keyword) This method starts the process of keyword spotting
-
Method Details
-
getSupportedLocales
Get the Locales available from this KSService- Returns:
- The Locales available from this service
-
getSupportedFormats
Set<AudioFormat> getSupportedFormats()Get the audio formats supported by this KSService- Returns:
- The audio formats supported by this service
-
spot
KSServiceHandle spot(KSListener ksListener, AudioStream audioStream, Locale locale, String keyword) throws KSException This method starts the process of keyword spottingThe audio data of the passed
AudioStreamis 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 passed
AudioStreammust be of a supportedAudioFormat. In other words anAudioFormatcompatible with one returned from thegetSupportedFormats()method.The passed
Localemust be supported. That is to say it must be aLocalereturned from thegetSupportedLocales()method.The passed
keywordis the keyword which should be spotted.- Parameters:
ksListener- Non-nullKSListenerthatKSEventevents targetaudioStream- TheAudioStreamfrom which keywords are spottedlocale- TheLocalein which the target keywords are spokenkeyword- The keyword to spot- Returns:
- A
KSServiceHandleused to abort keyword spotting - Throws:
KSException- if any parameter is invalid or a problem occurs- Implementation note:
- The method is supposed to return fast, i.e., it should only start the spotting as a background process.
-