fun with audio

Tuesday, May 28, 2002, at 07:56PM

By Eric Richardson

Currently my money-earning for the summer is doing contract audio work for Gospelcom. This work consists of taking audio Bibles and getting them online. These Bibles come in a number of formats (cds broken up by chapter, cds not broken up by chapter, tapes), which makes life fun. Anyway, I'm finally getting going on that and have started to get some fun stuff done to make my life easier. Click to read...

The first version that I'm just completing was of the cd with one big track variety (labeled Tape 1A, Tape 1B, etc). So that means I have to rip the cd, go in and break chapters out into their own files, and then do the encoding.


For the chapter breaking I'm currently using a Linux sound editor called audacity. It does a really nice job with quickly loading my 500+ meg wavs and letting me smoothly scroll through them. It's still a young project, and has a couple bugs (it likes to crash when I copy a file to the clipboard), but it's worlds ahead of where audio editing on Linux was when I last was really into it (three years ago, maybe).


The next interesting task I had to conquer was merging two files together (appending one to another). Right now I'm doing this via a command line app called ecasound. Annoyingly, there isn't just an option to append the files, so I have to manually figure out the length of the first file, and place the second after the first. I'm doing this via simple math:


$f1len = int($info[7] * 8 / 2 / 16 / 44100 + 1);


($info[7] is the filesize output from a stat call)


For those of you keeping score at home, that's filesize * 8 bits/byte / 2 channels / 16 bits / 44100 sample rate.


The encoder is just a perl script I wrote to front realproducer. It's cool in that I can say:


./scripts/encoder matt 2 - mark 4


and get the right files encoded.


That's it for now... As the summer goes on I'll be automating this process a lot more, right now I'm doing most stuff by hand.