javascriptaudiotext-to-speechspeech-synthesis

Is it possible to use the audio from SpeechSynthesisUtterance with audioMotion.js?


In the browser (using JavaScript and SpeechSynthesisUtterance), I'm able to do text to speech. Now I'd like to represent the utterance generated as visual audio in something like audioMotion.js. But libraries like AudioMotion need either a file or a stream as a source. I don't see how to get an audio stream from the speech produced by SpeechSynthesisUtterance. Is this even possible?


Solution

  • I think your suspicion is correct. SpeechSynthesisUtterance pipes the outgoing audio stream directly to the system (browser), and provides no option to redirect the audio stream to a JavaScript handler.