forked from Jibo-Revival-Group/JiboOs
44 lines
1.7 KiB
JavaScript
44 lines
1.7 KiB
JavaScript
/**
|
|
* @class EmbeddedListenEmitter
|
|
* @description Passed to the {@link jibo.bt.decorators.SucceedOnEmbedded~OnResult} function of the {@link jibo.bt.decorators.SucceedOnEmbedded|SucceedOnEmbedded} behavior.
|
|
* @extends EventEmitter
|
|
* @memberof jibo.bt
|
|
*/
|
|
|
|
/**
|
|
* @typedef {Object} jibo.bt.decorators.SucceedOnEmbedded~Options
|
|
*/
|
|
|
|
/**
|
|
* Called when the {@link jibo.bt.EmbeddedListenEmitter|EmbeddedListenEmitter} is constructed.
|
|
* @callback jibo.bt.decorators.SucceedOnEmbedded~OnResult
|
|
* @param {jibo.bt.EmbeddedListenEmitter} listener Use this instance to listen for listen events.
|
|
*/
|
|
|
|
/**
|
|
* @class SucceedOnEmbedded
|
|
* @extends jibo.bt.Decorator
|
|
* @memberof jibo.bt.decorators
|
|
* @description Succeeds the behavior its decorating when the specified audio phrase is spotted.
|
|
* @param {Object} options See {@link jibo.bt.Decorator|Decorator} for all options.
|
|
* @param {jibo.bt.decorators.SucceedOnEmbedded.Rules} options.rule The embedded rule to listen for.
|
|
* @param {jibo.bt.decorators.SucceedOnEmbedded~OnResult} options.onResult Called and passed a {@link jibo.bt.EmbeddedListenEmitter|EmbeddedListenEmitter} object. Events are
|
|
* fired from the emitter at certain points in this behavior's lifecycle.
|
|
*/
|
|
|
|
/**
|
|
* Embedded listen rule types.
|
|
* @name jibo.bt.decorators.SucceedOnEmbedded.Rules
|
|
* @property {String} HEY_jibo Listen for "Hey, Jibo"
|
|
* @static
|
|
* @enum {String}
|
|
*/
|
|
|
|
/** Listen for "Hey Jibo" */
|
|
|
|
/**
|
|
* Fired when the phrase is spotted.
|
|
* @event jibo.bt.EmbeddedListenEmitter#hey-jibo
|
|
* @param {Object} result Reference to the behavior's result.
|
|
* @param {Array} speakers Text independent speaker ID results.
|
|
*/ |