Triggers

Triggers are used to trigger events when an audio input is received.

Base

Trigger

class dobby.triggers.Trigger(event_queue)[source]

Threaded Trigger base class. A trigger will raise a RecognitionEvent or an CommandEvent when the detection is successful

Parameters:event_queue (Queue.Queue) – queue where to put the events
raise_event(event)[source]

Raise an event in the event_queue

stop()[source]

Stop the thread

Events

Events are raised by triggers to communicate

class dobby.triggers.RecognitionEvent[source]

A RecognitionEvent indicates that the recognition can be launched to analyze the next voice command

Clapper

The Clapper is used to match a Sequence of Blocks. The Pattern is composed of PatternItems that will validates or not, depending on its parameters, a specific kind of Block.

Sequence

Pattern

Clapper

Julius

class dobby.triggers.julius.Julius(event_queue, command, recognizer, action)[source]

Bases: dobby.triggers.Trigger

Analyze an audio source and put an event in the queue if voice command is spoken

Parameters:
  • command (string) – voice command to match
  • recognizer (Recognizer) – Julius Recognizer instance
  • action (boolean) – whether to fire CommandEvents or not