Most WAV files are longer than a few seconds, and you probably do not want a three-minute song playing every time you click a button. The sox program can be used to trim audio files, but you will need to know the starting time for the sound you want and the length. For example, to start 3 seconds into the file and keep a 2.31 second duration, use:
sox fileIN.mp3 fileOUT.wav trim 3 2.31
Trim times can be written in a variety of formats. You can specify seconds (and fractions of a second) or actual time values. The value 125.6 can be written as 2:05.6 or 0:2:5.6. The notations indicate seconds (with fractions), minutes, and hours. Also, if you do not specify the duration, then it goes to the end of the file.
The sox command can also add effects such as echos, high-pass and low-pass filtering, stretching, and reversing. For a full list of functions, refer to the sox man page (man sox).
Source of Information : Wiley Ubuntu Powerful Hacks And Customizations
No comments:
Post a Comment