Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
Types ¶
type Action ¶
type Action struct { MinActivationProb float32 // don't active when prob is low. MaxResetProb float32 // How low does the prob need to be for the utterance to have ended? CoolDownDuration time.Duration // how long after the utterance can a new utterance start? TimeLastCalled time.Time // when was the handlerFunc last called? HandlerFunction func(prob float32) // the func to be called when activated. // contains filtered or unexported fields }
Action is something that can be done in response a state
func MakeDefaultAction ¶
func MakeDefaultAction(run func()) (action Action)
MakeDefaultAction wraps a func() in an Action with sane defaults.
type EventBroker ¶
type EventBroker struct {
// contains filtered or unexported fields
}
EventBroker manages the stream of events.
func NewEventBroker ¶
func NewEventBroker(resultsChan chan map[libaural2.VocabName][]float32) (eb EventBroker)
NewEventBroker makes a new event broker from a chan of results
func (*EventBroker) Handle ¶
func (eb *EventBroker) Handle(results map[libaural2.VocabName][]float32)
Handle takes one result and passes it on to the actions
func (*EventBroker) Register ¶
func (eb *EventBroker) Register(vocab libaural2.VocabName, state libaural2.State, name string, action Action)
Register a function to be called
func (*EventBroker) Unregister ¶
Unregister the handler
Click to show internal directories.
Click to hide internal directories.