Concatenating Audio Files in with Perl on a Mac

G

Gary Morrison

I need to create a lot of fairly-short audio files from the
concatenation of a lot of even shorter audio files. I'd like to control
that from a Perl script. The audio files would presumably be AIFF or
WAV files, preferable AIFF.

Do any of you know of Perl commands to accomplish this? Specifically,
* A call to create and open a new, empty AIFF or WAV file,
* A call to append onto the end of that open audio file the audio
content of an existing non-empty audio file, and
* A call to close the created concatenation file.

Thanks for the ideas!
 
T

The Spanish Inquisition

Gary said:
I need to create a lot of fairly-short audio files from the
concatenation of a lot of even shorter audio files. I'd like to control
that from a Perl script. The audio files would presumably be AIFF or
WAV files, preferable AIFF.

Do any of you know of Perl commands to accomplish this? Specifically,
* A call to create and open a new, empty AIFF or WAV file,
* A call to append onto the end of that open audio file the audio
content of an existing non-empty audio file, and
* A call to close the created concatenation file.

Thanks for the ideas!

Try this: http://search.cpan.org/~taiy/Audio-SoundFile-0.15/

Ximinez
 
C

Chel van Gennip

I need to create a lot of fairly-short audio files from the
concatenation of a lot of even shorter audio files. I'd like to control
that from a Perl script. The audio files would presumably be AIFF or
WAV files, preferable AIFF.

I hope you are using OS X and have some knowledge of the Unix system, as
it is convenient for scripting. Make a script that, using SOX strips
headers and if needed convert to the same samplerate, samplewidth, etc.,
and outputs raw audio data to stdout. Input this raw datastream in SOX
through stdin to generate a WAF or AIIF file. http://sox.sourceforge.net/
 
G

Gary Morrison

Chel said:
I hope you are using OS X and have some knowledge of the Unix system, as
it is convenient for scripting.

"Yes" to both. I've done a bit of Perl scripting on my Sun workstation
at work.
Make a script that, using SOX strips
headers and if needed convert to the same samplerate, samplewidth, etc.,
and outputs raw audio data to stdout. Input this raw datastream in SOX
through stdin to generate a WAF or AIIF file. http://sox.sourceforge.net/

Ya know, thinking back a long time ago (I think it was around the time
when MacOS 7 first came out!), I wrote some code code to dork around
with AIFF files. I may be able to resurrect and adapt that code for
doing the actual opening and writing of the AIFF files themselves. If I
can find it, that is!
 
T

The Spanish Inquisition

Gary said:
"Yes" to both. I've done a bit of Perl scripting on my Sun workstation
at work.


Ya know, thinking back a long time ago (I think it was around the time
when MacOS 7 first came out!), I wrote some code code to dork around
with AIFF files. I may be able to resurrect and adapt that code for
doing the actual opening and writing of the AIFF files themselves. If I
can find it, that is!

Yeah, the sox stuff seems to be able to do almost anything. The syntax
learning curve is a bit steep, though, as I recall from previous
experiments.

Ximinez
 
G

Gary Morrison

The said:
Yeah, the sox stuff seems to be able to do almost anything. The syntax
learning curve is a bit steep, though, as I recall from previous
experiments.

I'll start with that. Thanks.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,764
Messages
2,569,567
Members
45,041
Latest member
RomeoFarnh

Latest Threads

Top