Closed fninsiima closed 6 years ago
@fninsiima Yes, you can use tts.blob()
, <a>
element with download
attribute, and href
attribute set to Blob URL
let ttsRecorder = new SpeechSynthesisRecorder({
text:"The revolution will not be televised",
utteranceOptions:{
voice: "english-us espeak",
lang: "en-US",
pitch: .75,
rate: 1,
volume: 1
}
});
ttsRecorder.start()
.then(tts => tts.blob())
.then(({tts, data}) => {
const a = document.createElement("a");
const blobURL = URL.createObjectURL(data);
a.download = "synthesizedAudio";
a.href = blobURL;
document.body.appendChild(a);
a.click();
})
.catch(err => console.log(err))
Just wondering if there is an option of saving the recording to file system