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.
Web Speech API's SpeechRecognition action component.
- sources
- goal: a stream
SpeechRecognition
properties. - cancel: a stream of
GoalID
. - SpeechSynthesis:
EventSource
forstart
,end
,error
,result
events.
- goal: a stream
- sinks
- state: a reducer stream.
- output: a stream for the SpeechRecognition driver input.
- result: a stream of action results.
result.result
is a transcript from the recognition; it will be''
for non-speech inputs.
Web Speech API's SpeechSynthesis action component.
- sources
- goal: a stream of
SpeechSynthesisUtterance
properties. - cancel: a stream of
GoalID
. - SpeechSynthesis:
EventSource
forstart
andend
events.
- goal: a stream of
- sinks
- state: a reducer stream.
- status: a stream of action status.
- result: a stream of action results.
result.result
is alwaysnull
. - SpeechSynthesis: a stream for the SpeechSynthesis driver input.
Web Speech API's SpeechRecognition driver factory.
-
Driver the SpeechRecognition Cycle.js driver function. It takes a stream of objects containing
SpeechRecognition
properties and returns aEventSource
:EventSource.events(eventName)
returns a stream ofeventName
events fromSpeechRecognition
.
Web Speech API's SpeechSynthesis driver factory.
-
Driver the SpeechSynthesis Cycle.js driver function. It takes a stream of objects containing
SpeechSynthesisUtterance
properties and returns aEventSource
:EventSource.events(eventName)
returns a stream ofeventName
events fromSpeechSynthesisUtterance
.