Interface KSEdgeService

All Superinterfaces:
KSService

@NonNullByDefault public interface KSEdgeService extends 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 Details

    • spot

      KSServiceHandle spot(KSListener ksListener) throws KSException
      This method links the remote keyword spotting process to a consumer. The method is supposed to return fast.
      Parameters:
      ksListener - Non-null KSListener that KSEvent 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 passed AudioStream is passed to the keyword spotting engine. The keyword spotting attempts to spot keyword as being spoken in the passed Locale. Spotted keyword is indicated by fired KSEvent events targeting the passed KSListener. The passed AudioStream must be of a supported AudioFormat. In other words an AudioFormat compatible with one returned from the getSupportedFormats() method. The passed Locale must be supported. That is to say it must be a Locale returned from the getSupportedLocales() method. The passed keyword 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 interface KSService
      Parameters:
      ksListener - Non-null KSListener that KSEvent events target
      audioStream - The AudioStream from which keywords are spotted
      locale - The Locale in which the target keywords are spoken
      keyword - The keyword which to spot
      Returns:
      A KSServiceHandle used to abort keyword spotting
      Throws:
      KSException - if any parameter is invalid or a problem occurs