Help | Site Map
Connecting Tech Pros Worldwide
 
 
LinkBack Thread Tools
  #1  
Old March 26th, 2006, 01:55 PM
Gary Morrison
Guest
 
Posts: n/a
Default Concatenating Audio Files in with Perl on a Mac

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!

--

(Preferably reply to the newsgroup, please. If you reply by Email, I
will sincerely try to receive your message, but it will probably get
buried in spam.)
  #2  
Old March 26th, 2006, 02:45 PM
The Spanish Inquisition
Guest
 
Posts: n/a
Default Re: Concatenating Audio Files in with Perl on a Mac

Gary Morrison wrote:[color=blue]
> 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![/color]

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

Ximinez
--
Our three weapons are fear, surprise, and ruthless efficiency...
and an almost fanatical devotion to the Pope....
http://www.ai.mit.edu/people/paulfitz/spanish/t1.html
  #3  
Old March 27th, 2006, 02:55 AM
Gary Morrison
Guest
 
Posts: n/a
Default Re: Concatenating Audio Files in with Perl on a Mac

Chel van Gennip wrote:
[color=blue]
> I hope you are using OS X and have some knowledge of the Unix system, as
> it is convenient for scripting.[/color]

"Yes" to both. I've done a bit of Perl scripting on my Sun workstation
at work.
[color=blue]
> 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/[/color]

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!

--

(Preferably reply to the newsgroup, please. If you reply by Email, I
will sincerely try to receive your message, but it will probably get
buried in spam.)
  #4  
Old March 27th, 2006, 05:45 AM
The Spanish Inquisition
Guest
 
Posts: n/a
Default Re: Concatenating Audio Files in with Perl on a Mac

Gary Morrison wrote:[color=blue]
> Chel van Gennip wrote:
>[color=green]
>> I hope you are using OS X and have some knowledge of the Unix system, as
>> it is convenient for scripting.[/color]
>
> "Yes" to both. I've done a bit of Perl scripting on my Sun workstation
> at work.
>[color=green]
>> 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/[/color]
>
> 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![/color]

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
--
Our three weapons are fear, surprise, and ruthless efficiency...
and an almost fanatical devotion to the Pope....
http://www.ai.mit.edu/people/paulfitz/spanish/t1.html
  #5  
Old March 28th, 2006, 12:55 AM
Gary Morrison
Guest
 
Posts: n/a
Default Re: Concatenating Audio Files in with Perl on a Mac

The Spanish Inquisition wrote:
[color=blue]
> 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.[/color]

I'll start with that. Thanks.

--

(Preferably reply to the newsgroup, please. If you reply by Email, I
will sincerely try to receive your message, but it will probably get
buried in spam.)
 

Bookmarks


Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are Off
[IMG] code is Off
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On

What is Bytes?

We are a network of experts and professionals in IT and software development that help one another with answers to tough questions and share insights. Get the best answers to your questions from over network members.
Post your question now . . .
It's fast and it's free

Popular Articles