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 :)

  • Not here any more

    The new Terms of Service for livejournal wants to regulate certain types of political content which have been deemed inappropriate for children by…

  • BiFest

    Apparently there is a BiFest on Saturday 8th April, approximately 10 minutes walk from my house. This is so very close that I really have no excuse…

  • New-to-me doctors never understand me

    Today I experienced the joy which is seeing a doctor who doesn't know me. Apparently my usual GP is on holiday somewhere warm, lucky woman. So I was…

  • Post a new comment


    Anonymous comments are disabled in this journal

    default userpic

    Your reply will be screened

    Your IP address will be recorded