Search code examples
javascriptaudiotext-to-speech

Audio visualizer on Artyom.js voice


how can i do some audio visualizer on Artyom.js's voice. I know how to do song visualizer, but the problem is I always used something like this.

new (window.AudioContext || window.webkitAudioContext)()
.createAnalyser()
.createGain() 

But with Artyom I have this.

artyom.say(text)

So How can i access the text readed in real time for the audio vizualizer?


Solution

  • that ".say" call uses the browser's SpeechSynthesis API, which doesn't go through an audio context. Consider using something like mespeak.js or Google TTS or whatnot, which you can pass through an Audio Context instead.