The Audio Programming Book: Errata

In this post I’ll try to keep track of mistakes I found in “The Audio Programming Book”. It will get updated frequently.
If you have found some problems on your own, I’d appreciate you posting it to the comments. I would append them to this post and for sure accredit it to you.
Continue reading “The Audio Programming Book: Errata”

Audio Programming

I didn’t use this blog a lot lately, but I really want to keep it alive. At the moment I’m trying to get my hands on Audio Programming in C, the (quite far away) goal is to do some audio manipulation with embedded devices (maybe with Arduino, maybe something more powerful).
My starting point is the newly released “The Audio Programming Book” by Richard Boulanger and Victor Lazzarini. Since I worked through maybe half of the book, I’m still not really advanced, but I will keep track of my process by posting some code here.
The book is wonderful and really a complete compendium on audio programming knowledge (coding style, data structures, mathematical foundations, …) while still aimed more towards the programming musician than the music-playing programmer. That said, since it’s the first edition, there are still some errata. If you find some, you may post them to the errata thread at the group dedicated to the book over at noisepages. I will also try to cover some of the problems here.

batch-converting audio using soX (for arduino waveshield)

i’m currently experimenting with the waveshield a.k.a. audioshield for arduino by ladyada. it’s a pretty handy extension for arduino thats add’s the capability to output audio and read/write sd-cards with arduino, they also provide nice libraries to work with. in respect to¬† the limited calculating power of the arduino it can only play uncompressed wave files that are mono, have a samplerate of maximum 22khz and a resolution of 16 bit. this is quite ok for most things you would like to do with it, but you first have to convert most wave files you have to this format.

on the waveshield’s website there are instructions for the conversion with itunes and audacity, but they also point to converting files with soX. soX (sound eXchange) calls itself to be the “swiss army knife of sound processing programs” and, yes, it is! it’s a small cross-platform command-line utility that can perform manipulations and conversion of audio in all thinkable kinds of formats – the list of features is truely impressive.

i only wanted to use it to convert wavefiles in different folders to a waveshield-compatible format without touching the original files while preserving the original folderstructure, so i wrote a little bash-script to do this. you might use the script for just that purpose as is. nevertheless it should be easy to edit the script for doing all kinds of batchprocessing with soX, i.e. editing the volume of your audio data or even apply effects to them. just have a look a soX’ manpage to see what you can do with it.
Continue reading “batch-converting audio using soX (for arduino waveshield)”