简体   繁体   English

使用fluent-ffmpeg转换AWS Polly音频流

[英]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. 我正在尝试使用fluent-ffmpeg从Node.js中的Amazon AWS Polly转换音频流。 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的输出所提供的,但是却出现“输入无效”错误。

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) AudioStream:} 2017-07-27T14:07:09.335Z dd75614c-72d4-11e7-b7cd-5d4425c782fc错误:FfmpegCommand.proto.mergeAdd.proto.addInput.proto.input输入无效的输入(/ var / task / node_modules / fluent- FFMPEG / LIB /选项/ 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. 我知道Polly的输出是有效的音频流,因为我能够将其保存到S3存储桶中。 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. 我宁愿在保存到S3之前先对其进行转换,而不是保存它,从S3中拾取它,进行转换然后再次保存。

Thanks for your help! 谢谢你的帮助!

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

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

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