简体   繁体   中英

Converting AWS Polly Audio Stream with fluent-ffmpeg

I am trying to convert an audio stream from Amazon AWS Polly in Node.js using fluent-ffmpeg. The documentation says that I can convert a stream, which is what the output of Polly provides, but I am getting an "Invalid input" error.

polly.synthesizeSpeech(pollyParams, function (err, data) {
if (err) {
    console.log(err)
} else {
    console.log('Audio')
    console.log(data)
    ffmpeg().input(data.AudioStream).inputOptions(['-ac 2', '-codec:a libmp3lame', '-b:a 48k', '-ar 16000']) 
}  

Results in:

AudioStream: } 2017-07-27T14:07:09.335Z dd75614c-72d4-11e7-b7cd-5d4425c782fc Error: Invalid input at FfmpegCommand.proto.mergeAdd.proto.addInput.proto.input (/var/task/node_modules/fluent-ffmpeg/lib/options/inputs.js:34:15)

I know the output from Polly is a valid audio stream, because I am able to save it to an S3 bucket. I would prefer to convert the stream before saving to S3, rather than saving it, picking it up from S3, converting it, and then saving it again.

Thanks for your help!

没关系...看起来像是ffmpeg的错误: https//github.com/fluent-ffmpeg/node-fluent-ffmpeg/issues/616

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM