VideoHelp Forum




+ Reply to Thread
Results 1 to 6 of 6
  1. Let's say I have a wav file that is 5 minutes long, but I need to remove exactly 512ms of audio at exactly 2:30.192. How would I do this with SoX? I'm looking essentially for the opposite effect of the pad command where you can insert audio samples at specific points in the wav. The end result would be the original file minus the 512ms; I do NOT want to extract 512ms, I want to delete it.
    Quote Quote  
  2. Member leghorn's Avatar
    Join Date
    Apr 2007
    Location
    Germany
    Search Comp PM
    Hmm, I'd say select the parts you want to keep, copy/paste and leave out the rest. I'm not sure how SoX works, but maybe you could copy data from 0:00.000 to 2:30.192 to be part one. Then copy from 2:30.704 to the end to be part two. Eventually join parts one and two.
    Das Leben ist eine Nebelwand voller Rasierklingen. (C. Bukowski)
    Quote Quote  
  3. Banned
    Join Date
    Oct 2004
    Location
    Freedonia
    Search Comp PM
    SoX is a command line tool. It's old as crap, being designed MANY years ago to allow (at the time) mostly non-Windows systems to have a way to convert between many file types. So your guess is as good as mine. If you want to use ancient command line tools like SoX, you're on your own. I'm just about the only guy here who's even heard of it, but I last used it in the 1990s and even then I only used it to convert some files into Sun's weird low quality audio format at the time (AIW if I remember correctly).

    Geez, agni451, Audacity is available for Windows, Mac and Linux. If that can't meet your needs instead of SoX, there's really no hope for you.
    Quote Quote  
  4. Originally Posted by leghorn View Post
    Hmm, I'd say select the parts you want to keep, copy/paste and leave out the rest. I'm not sure how SoX works, but maybe you could copy data from 0:00.000 to 2:30.192 to be part one. Then copy from 2:30.704 to the end to be part two. Eventually join parts one and two.
    Yeah, I thought of that, I was just hoping I could do this in one operation instead of 3.

    Originally Posted by jman98 View Post
    SoX is a command line tool. It's old as crap, being designed MANY years ago to allow (at the time) mostly non-Windows systems to have a way to convert between many file types. So your guess is as good as mine. If you want to use ancient command line tools like SoX, you're on your own. I'm just about the only guy here who's even heard of it, but I last used it in the 1990s and even then I only used it to convert some files into Sun's weird low quality audio format at the time (AIW if I remember correctly).

    Geez, agni451, Audacity is available for Windows, Mac and Linux. If that can't meet your needs instead of SoX, there's really no hope for you.
    Thank you for the extremely unhelpful reply. I NEED a command-line tool for my purposes, and if you can't help, then there's no need to post.
    Quote Quote  
  5. Yeah, I thought of that, I was just hoping I could do this in one operation instead of 3.
    afaik there's no way to do the whole thing in a single sox call, the typical way would be:
    1. extract the start
    Code:
    sox too-long.wav start.wav trim 0 2:30.192
    2. extract the end (-> length = 5min - 2:30.704min = 2:29.296 min)
    Code:
    sox too-long.wav end.wav trim 2:30.704 2:29:296
    3. concatenate the parts
    Code:
    sox start.wav end.wav joined.wav
    using the 'newfile' feature you could probably first split the too-long.wav into three parts and than merge part1&part3 this way you would only have to call sox twice, but you would create an additional temporary file that need to be deleted later.

    @jman98: Audacity is nice if you want to handle one file, but if you have e.g. 1000 files where you need to do some audio manipulations, a command line tool and a small script normally does the job far better,...

    Cu Selur
    Quote Quote  
  6. Member leghorn's Avatar
    Join Date
    Apr 2007
    Location
    Germany
    Search Comp PM
    To avoid three single steps, maybe you can work Selur's suggestion into a batch script...
    Das Leben ist eine Nebelwand voller Rasierklingen. (C. Bukowski)
    Quote Quote  



Similar Threads

Visit our sponsor! Try DVDFab and backup Blu-rays!