How do I save an audio to a folder with gtts using javascript?

Asked

Viewed 46 times

0

I am writing a Javascript program and need to save an audio file using gtts or any other sound library. My code:

var texto = "Preciso ser um arquivo de áudio";
var filepath = "mp3/song.wav";

gtts.save(filepath, texto, function() {
console.log(`${filepath} MP3 SALVO`)
});
  • See just Will this code run on the client or server? Or ... is it in an html page or is it in a Node.js ? If it’s on the page, what you have to do is download the sound file that was generated. Javascript cannot record to the client’s disk. Only through download.

  • It is running on Node.js

  • And the contents of the sound file, where it is ?

No answers

Browser other questions tagged

You are not signed in. Login or sign up in order to post.