Concatenating Audio Files in with Perl on a Mac

Discussion in 'Perl' started by Gary Morrison, Mar 26, 2006.

  1. 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.)
     
    Gary Morrison, Mar 26, 2006
    #1
    1. Advertising

  2. Gary Morrison wrote:
    > 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
    --
    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
     
    The Spanish Inquisition, Mar 26, 2006
    #2
    1. Advertising

  3. On Sun, 26 Mar 2006 15:47:32 +0200, Gary Morrison wrote:

    > 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/

    --
    Chel van Gennip
    Visit Serg van Gennip's site http://www.serg.vangennip.com
     
    Chel van Gennip, Mar 26, 2006
    #3
  4. Chel van Gennip wrote:

    > 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!

    --

    (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.)
     
    Gary Morrison, Mar 27, 2006
    #4
  5. Gary Morrison wrote:
    > Chel van Gennip wrote:
    >
    >> 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!


    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
     
    The Spanish Inquisition, Mar 27, 2006
    #5
  6. The Spanish Inquisition wrote:

    > 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.

    --

    (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.)
     
    Gary Morrison, Mar 28, 2006
    #6
    1. Advertising

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

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. aeonsun
    Replies:
    2
    Views:
    449
    Luc The Perverse
    Mar 11, 2007
  2. sasuke
    Replies:
    5
    Views:
    2,166
    Tom Anderson
    Jul 6, 2008
  3. Igor R.

    concatenating binary files

    Igor R., Jan 15, 2009, in forum: C++
    Replies:
    2
    Views:
    799
  4. William

    Concatenating 2 Perl Strings

    William, Dec 22, 2005, in forum: Perl Misc
    Replies:
    2
    Views:
    140
  5. sick dick
    Replies:
    0
    Views:
    406
    sick dick
    Apr 3, 2006
Loading...

Share This Page