我正在尝试让 AWS Polly 保存 URL 内容的 mp3 音频转录。我已经尝试了几个预先烘焙的脚本,但它们似乎都不起作用。
这是我的目标蓝图: (1) lambda 函数 - 调用 polly api StartSpeechSynthesisTask - 用作文本,URL 的内容 - 将音频文件保存在 s3
这是我在 Lambda 中尝试过的
var request = require("request");
request({uri: "https://www.canalmeio.com.br/ultima-edicao/"}, /*this is the URL where I pick up the text */
function(error, response, body) {
console.log(body);
});
});
var params = {
OutputFormat: mp3,
OutputS3BucketName: 'BUCKETNAMEXXXX'',
Text: console.log,
VoiceId: Cristiano,
Engine: standard,
LanguageCode: pt-BR,
OutputS3KeyPrefix: 'meio',
SampleRate: '22050',
TextType: text
};
polly.startSpeechSynthesisTask(params, function(err, data) {
if (err) console.log(err, err.stack); // an error occurred
else console.log(data); // successful response
});
我希望输出是保存在我的 s3 存储桶中的 MP3 文件。