Using Sox to Extract Subparts of a File
The trim effect copies the portion of the input starting at start and ending at start plus length to the output. Both parameters may be specified either as numbers of samples, consisting of an integer followed by the letter s, e.g. "8700s" or a time value. Time values are of the form ((hh:)mm:)ss(.fs). A bare integer is therefore a time value in seconds.
For example, suppose that you have a recording 1 hour long and wish to cut it into two halves. The following two commands will leave the first half in Half1.wav and the second half in Half2.wav.
sox Input.wav Half1.wav trim 0 30:00
sox Input.wav Half2.wav trim 30:00 30:00
The original file is unaffected, so once you have confirmed that the two output files contain what they should, you may delete the original if you wish to.
Sox is extensible, and has (installable) support for many formats including wav,flac,mp3 etc