@cycle-robot-drivers/speech v1.2.6
@cycle-robot-drivers/speech
Cycle.js drivers and action components for speech synthesis and recognition using Web Speech API.
Try the demo at StackBlitz!
Note that this package was tested with Chrome browser (>= 65.0.3325.181) only.
API
SpeechRecognitionAction(sources)
Web Speech API's SpeechRecognition action component.
Params:
- sources
- goal: a stream
SpeechRecognitionproperties. - cancel: a stream of
GoalID. - SpeechSynthesis:
EventSourceforstart,end,error,resultevents.
- goal: a stream
Return:
- sinks
- state: a reducer stream.
- output: a stream for the SpeechRecognition driver input.
- result: a stream of action results.
result.resultis a transcript from the recognition; it will be''for non-speech inputs.
SpeechSynthesisAction(sources)
Web Speech API's SpeechSynthesis action component.
Params:
- sources
- goal: a stream of
SpeechSynthesisUtteranceproperties. - cancel: a stream of
GoalID. - SpeechSynthesis:
EventSourceforstartandendevents.
- goal: a stream of
Return:
- sinks
- state: a reducer stream.
- status: a stream of action status.
- result: a stream of action results.
result.resultis alwaysnull. - SpeechSynthesis: a stream for the SpeechSynthesis driver input.
makeSpeechRecognitionDriver()
Web Speech API's SpeechRecognition driver factory.
Return:
Driver the SpeechRecognition Cycle.js driver function. It takes a stream of objects containing
SpeechRecognitionproperties and returns aEventSource:EventSource.events(eventName)returns a stream ofeventNameevents fromSpeechRecognition.
makeSpeechSynthesisDriver()
Web Speech API's SpeechSynthesis driver factory.
Return:
Driver the SpeechSynthesis Cycle.js driver function. It takes a stream of objects containing
SpeechSynthesisUtteranceproperties and returns aEventSource:EventSource.events(eventName)returns a stream ofeventNameevents fromSpeechSynthesisUtterance.
6 years ago
6 years ago
6 years ago
6 years ago
6 years ago
6 years ago
6 years ago
7 years ago
7 years ago
7 years ago
7 years ago
7 years ago
7 years ago
7 years ago
7 years ago
7 years ago
7 years ago
7 years ago
7 years ago
7 years ago
7 years ago