Beefy Boxes and Bandwidth Generously Provided by pair Networks
No such thing as a small change

Splitting Wave Files

by Anonymous Monk
on Apr 26, 2004 at 03:29 UTC ( #348061=perlquestion: print w/replies, xml ) Need Help??

Anonymous Monk has asked for the wisdom of the Perl Monks concerning the following question:

I'm wanting to split one .wav file into several 10 second ones... Any one know the proper module(s) I should use? Many thanks in advance.

Replies are listed 'Best First'.
Re: Splitting Wave Files
by Zaxo (Archbishop) on Apr 26, 2004 at 04:02 UTC

    A CPAN search coughed up Audio::Wav right away, but it failed its test suite for me.

    Encoding and decoding wav files is a splendid way to learn pack/unpack, however. You will have difficulty if you hit exotic or proprietary compression formats.

    After Compline,

Re: Splitting Wave Files
by toma (Vicar) on Apr 26, 2004 at 07:29 UTC
    You should use sox. There is no CPAN sox module as far as I can tell, but it wouldn't be too hard to write one.

    Sox is a command line tool for manipulating audio files. It has a trim function that can be used to split audio files.

    Sox is fast. The fastest perl module for audio that I know of is Audio::Data, but it works on .au files not .wav. You can convert between these formats with sox. But once you have sox you won't need Audio::Data anyway.

    It should work perfectly the first time! - toma
Re: Splitting Wave Files
by cyocum (Curate) on Apr 26, 2004 at 10:16 UTC

    This is a non-perl solution but you could use Audacity, which is a free open source sound file editor. It seems pretty nifty to me.

Re: Splitting Wave Files
by zentara (Archbishop) on Apr 26, 2004 at 14:12 UTC
    A few apps to do this have been popping up on This one seems nice WavBreaker

    And there is a commandline wavsplit

    I'm not really a human, but I play one on earth. flash japh

Log In?

What's my password?
Create A New User
Node Status?
node history
Node Type: perlquestion [id://348061]
Approved by pbeckingham
Front-paged by broquaint
and the web crawler heard nothing...

How do I use this? | Other CB clients
Other Users?
Others examining the Monastery: (10)
As of 2019-06-25 12:25 GMT
Find Nodes?
    Voting Booth?
    Is there a future for codeless software?

    Results (106 votes). Check out past polls.