服务器端音频混合器。有什么可用? (Csound可以做到吗?)
我有兴趣了解是否存在可以执行以下任务的程序或库,并且适合作为网站上服务器端进程的一部分运行。 (如果花费的时间超过单页请求合理的 200 毫秒最大值也没关系 - 我可以将其作为异步进程运行。)
任务是这样的:我有一组音频文件作为输入,并且我有一些有关每个音频文件何时应在时间线中开始播放的数据。该程序应输出一个音频文件,该文件是输入音频的混合,并使用时间线数据组合。也就是说,我想要一个以批处理模式运行的音频混合器,而不是实时运行。
我已经做了一些谷歌搜索,但有点沮丧,因为我不太确定我应该寻找什么。大多数音频混音器似乎都面向游戏等实时应用程序,我不确定如何找到像命令行实用程序一样执行此任务的东西 - 纯粹接受输入,并尽可能快地生成输出。
我希望这个问题有意义。
编辑:有人评论了 Csound,然后将其删除。什么是Csound?做我所要求的事情相对简单吗?请记住,我的输入声音文件的长度可能在 10-50 秒之间,而且我对音调失真不感兴趣。
您将如何在 Csound 中实现这一目标?
除了Csound之外还有什么可以做这种事情吗?
I am interested in finding out if there exists a program or library which can perform the following task, and would be suitable for running as part of a server side process on a web site. (It's okay if it takes longer than the 200 milisecond maximum that is reasonable for a single page request - I can run it as an asynchronous process.)
The task is this: I have as input a set of audio files, and I have some data about when each audio file should start playing in a timeline. The program should output an audio file which is a mix of the input audio, combined using the timeline data. That is, I want an audio mixer that operates in batch mode, and not in real time.
I've done some Google searches, but came up a bit frustrated because I'm not exactly sure what I should be looking for. Most audio mixers seem geared towards real time applications like games, and I'm not sure how to find something that does this task as something like a command line utility - purely taking input, and producing output as fast as it can.
I hope this question makes sense.
Edit: Someone commented about Csound, and then deleted it. What is Csound? Is it relatively straightforward to do what I'm asking? Keep in mind that my input sound files may be between 10-50 seconds long, and I'm not interested in pitch distortion.
How would you accomplish this in Csound?
Is there anything other than Csound that can do this sort of thing?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(6)
您绝对可以使用 Csound 来实现此目的,并且可以通过多种方式实现它。不幸的是,我对 Csound 的研究还处于起步阶段,更多地涉及音频合成和算法组合,而不是采样和处理,因此我无法提供稳健实现的建议。
但是,我猜测您的项目的管弦乐文件(Csound程序的一部分,包含音频合成和处理信息,包含在名为乐器的模块中)将涉及
soundin
操作码,它从音频文件中读取,然后缩放各种流的幅度并在传递到输出之前将它们混合。时间线可能会在乐谱文件(Csound 程序中处理乐器和函数表初始化的部分)中进行处理,该文件会将时间线数据转换为播放计时。
您还可以查找 Csound 的
GEN01
子例程,该子例程将音频数据从文件读取到函数表中。You can definitely use Csound for this, and it could be implemented a number of ways. Unfortunately, my still fairly nascent study of Csound has been more involved with audio synthesis and algorithmic composition than sampling and processing, so I can't offer suggestions for a robust implementation.
However, I would guess that your project's orchestra file (the part of a Csound program that contains audio synthesis and processing information, contained in modules called instruments) would involve the
soundin
opcode, which reads from an audio file, and then it would scale the amplitude of various streams and mix them before passing to output.The timeline would probably be handled in the score file (the part of a Csound program that handles initialization of instruments and function tables), which would translate your timeline data into playback timing.
You might also look up Csound's
GEN01
subroutine, which reads audio data from a file into a function table.如果您愿意考虑在此过程中运行批处理脚本,您可能会发现 SoX 很有用。它的“混音器”和“混音”命令看起来可能会有帮助,尽管您可能需要在声音文件的开头渲染空白空间来处理偏移。
If you are willing to consider running batch scripts as part of this process, you might find SoX useful. Its "mixer" and "remix" commands look like they might be helpful, although you would possibly need to render empty space at the start of sound files to handle offsets.
你应该看看SuperCollider。也许这对你有用。
You should have a look at SuperCollider. Maybe that would do the trick for you.
类似于 PHP 的 OpenAL 绑定?
Something like PHP's OpenAL bindings?
您可以查看BASS 音频库。我无法看到它是否可以比实时混合得更快,因为它被防火墙阻止了,但我发现它过去使用起来很友好。
You might look at the BASS Audio Library. I'm unable to see if it can mix faster-than-real-time, as it's blocked at the firewall, but I've found it friendly to use in the past.
由于您提出问题的方式,您可能会收到很多关于实时音频解决方案的建议:
“输入音频”非常模糊。对我来说,这听起来像是实时输入流(如麦克风)。
如果您根本不处理实时 I/O 流,那么 Csound 可能是一个候选者。网上有很多 Csound 教程。
You are probably getting a lot of suggestions towards real-time audio solutions because of the way you have phrased your question:
"Input audio" is very vague. To me it sounds like a live input stream (like a microphone).
If you are not dealing with live I/O streams at all, then yes, Csound would be a likely candidate. There are plenty of Csound tutorials online.