I want to buffer audio from url using axios in modern js not jQuery
var url = 'https://my_image.jpg' // example
url = axios.get(url, { responseType: 'arraybuffer' });
return Buffer.from(url.data);
The above code buffers image, In order to buffer audio like that, What should I do?
I used responseType: 'blob' to buffer audio from url but it couldn't be played, its 0 seconds. But in url its 7 seconds.
var url = 'https://translate.google.com/translate_tts?ie=UTF-8&q=Hello%20Everyone!%20How%20are%20you?&tl=en&total=1&idx=0&textlen=5&client=tw-ob&prev=input&ttsspeed=1'
I wanna buffer the audio url in the above variable using axios in modern js.
Also i need help in making a global regex for '\n'. I wanna replace all '\n' with space ( ' ' )