繁体   English   中英

如何使用 Amazon S3 存储连接和上传音频

[英]How to concatenate and upload audio using Amazon S3 storage

我的目标是使用getObject()方法检索当前存储在s3存储桶中的两个单独的音频文件,然后连接这两个文件并使用s3.upload()audio1audio2的组合音频剪辑上传回s3 有没有办法将audio1audio2结合起来,然后将这些结果上传回s3存储桶?

  const audio1 = await s3.getObject({
    Bucket: 'Bucket',
    Key: bucket1.audio1.s3Key,
  }).promise();

  // the second audio file to be concatenated to the first one
  const audio2 = await s3.getObject({
    Bucket: 'Bucket',
    Key: bucket1.audio2.s3Key,
  }).promise();

  // combine and upload 'audio1' and 'audio2' as a new obj back to s3 bucket

您可以使用 ffmpeg。 在命令行上,您可以这样做:

ffmpeg -i "concat:audio1.mp3|audio2.mp3" -acodec copy out.mp3

这将audio1.mp3audio2.mp3out.mp3

要使用 NodeJS 做到这一点,您可以尝试使用 package fluent-ffmpeg/node-fluent-ffmpeg 或者 ffmpeg 的另一个 NodeJS 包装器。

暂无
暂无

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

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