Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Record HTML5 SpeechSynthesisUtterance generated speech to file

I am able to generate speech from text using Chrome's Speech Synthesis API (in Version 33.0.1750.112 beta-m) in the following manner

var transcript = document.getElementById("speechTxt").value; 
var msg = new SpeechSynthesisUtterance(transcript); 
speechSynthesis.speak(msg);

Now I want to save this speech in a file (maybe using WebAudio API). Is this possible through some function call?

I have looked at the methods in Speech Synthesis API and there is nothing to save this speech data. Using WebAudio API I am able to capture this speech sound in the microphone but that introduces a lot of unnecessary noise. Is it not possible to save this speech data inside the Chrome browser itself as it is the one which is generating it in the first place?

like image 290
Soumen Basak Avatar asked Feb 20 '14 10:02

Soumen Basak


1 Answers

Unforunately no. Apparently there was no major use case, see this answer

But you can use a js TTS library like mespeak. It outputs buffers that can be played back via web audio buffer nodes. (Although the engine it does not sound as natural chrome's).

like image 198
ElDog Avatar answered Jan 05 '23 04:01

ElDog