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?
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
soundinopcode, 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
GEN01subroutine, which reads audio data from a file into a function table.