Text-to-Speech

FREE
By voicerss | Updated 15일 전 | Media
Popularity

9.8 / 10

Latency

869ms

Service Level

100%

Health Check

N/A

Back to All Discussions

to play the audio, here is my code

to play audio, just add b64 = ‘true’. and just pass the response.data to audio src.!
here is my code.

export async function speak({ trans, lang, voice,speed }, caller = () => { }) {
var options = {
method: ‘GET’,
url: https://voicerss-text-to-speech.p.rapidapi.com/,
params: {
key: ‘2621446e80894ff89a7b79769cba0202’,
src: trans || ‘text is not defind’,
hl: lang,
v: voice,
r: speed,
c: ‘mp3’,
f: ‘8khz_8bit_stereo’,
b64: true,
// f: ‘16khz_16bit_stereo’,
},
headers: {
‘X-RapidAPI-Host’: ‘voicerss-text-to-speech.p.rapidapi.com’,
‘X-RapidAPI-Key’: ‘aff1177afamsh1fb255402c24c5ap1be9e4jsn4efe400f2d7e’
}
};

const res = await axios.request(options)
return res.data

}

const audio = speak(…)
<audio src={audio}/>

Rapid account: Intizarahmad 853
intizarahmad853 Commented 2년 전

you are such an amazing guy! you should be proud of that

Rapid account: Christophersoncrant
christophersoncrant Commented 2년 전

Thanks for this!

Join in the discussion - add comment below:

Login / Signup to post new comments