我正在重新测试请求类型为“text/plain”的音频。正确的输入类型为“application/ssml+xml”。
我正在使用ivona节点库获取音频。
格式如下:
var audioText = '<?xml version="1.0"?><speak version="1.0" xmlns="http://www.w3.org/2001/10/synthesis" xml:lang="en-US"><p><s>This is the first sentence of the paragraph.</s><s>Here is another sentence.</s></p></speak>';
ivona.createVoice(audioText, {
body: {
input: {
data: null,
type: 'application/ssml+xml'
},
voice: {
name: 'Raveena',
language: 'en-IN',
gender: 'Female'
}
}
}).pipe(fs.createWriteStream('output.mp3'));