helen-louise (baratron) wrote,

  • Mood:

sox is doing my head in!

I think one of the best investments we made was a CD burner. It only cost £60, and it's saved me huge amounts of time and effort. Before we had it, I used to have to give CDs to Richard to copy at work. Anyone who's tried to meet up with him in an evening will know what happens to him at work - he tends to get stuck there ages after he's planned to leave, and he never gets round to doing half the things he meant to do. The average turnaround time for him to do a straight disc-to-disc transfer for me was about two weeks, so you can only imagine how long it would have taken for him to get round to making up CD compilations for me.

Now that we have a burner at home, I make up compilations whenever I feel like it. It's not normally too difficult, unless you find that your input CDs were recorded at wildly differing volumes. We don't have any sophisticated audio software, and so far we've never needed any. I do audio processing with nothing more user-friendly than command-line sox. However, I'm failing to make any sense out of this part of man sox:

fade [ type ] fade-in-length [ stop-time [ fade-out-length ] ]

Add a fade effect to the beginning, end, or both of the audio data.

For fade-ins, this starts from the first sample and ramps the volume of the audio from 0 to full volume over fade-in-length seconds. Specify 0 seconds if no fade-in is wanted.

For fade-outs, the audio data will be trucated at the stop-time and the volume will be ramped from full volume down to 0 starting at fade-out-length seconds before the stop-time. No fade-out is performed if these options are not specified.

I typed in sox infile.wav oldfile.wav fade 0 200 4, and got a four-second sample out instead of the 200-second sample I'd been expecting. Various fiddling, and I discovered sox infile.wav oldfile.wav fade 0 2000 gives a 52-second file. Clearly, stop-time is not measured in seconds. But what is it measured in?

Update: 21:00. There seems to be a bug in sox version 12.17.1. stop-time should indeed be measured in seconds. Downloading 12.17.3 fixed the problem. Just thought I'd let you know :)

  • Several bits make a post

    Yesterday and today, I've been wanting to talk to people but I have absolutely no spare energy with which to do so. I have reverted to taking 2000 iu…

  • WTB: Concentration

    Does anyone have a concentration span I could borrow? Turns out that my physiotherapy course and poster presentation don't actually clash, because…

  • Still alive.

    Urgh. I switched on my computer in the hope I might write something, but I just don't have the spoons. I've been like this for weeks - not really…

  • Post a new comment


    Anonymous comments are disabled in this journal

    default userpic

    Your reply will be screened

    Your IP address will be recorded