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

  • Still alive.

    I am alive. Coping with the hiatus hernia. Perhaps in a one damned thing after another sort of way. Still, the symptoms have all improved…

  • Too much stuff happening

    So tired. It's been a long week. Wednesday - Stayed up way too late to run a new dungeon on the public test server of Elder Scrolls Online on…

  • Plans

    I did not get around to booking for BiCon. The closing date for accommodation was just too early considering that I have no idea what my health will…

  • Post a new comment


    Anonymous comments are disabled in this journal

    default userpic

    Your reply will be screened

    Your IP address will be recorded