Thursday, May 21, 2009

Streaming audio!

Yesterday morning, I started on functions to run web-based streaming audio into a speech recognition application. Using some http code I wrote, libmad, the libmad documentation project, and Google's Code Search, I successfully got audio into my application this afternoon.

The http code I developed a few years ago for another proof of concept app. However, the site I'm using for testing has two or three redirects and so I had to add 3xx handling to my http code, since this is a bare bones implementation.

Then it turned out that libmad was not well documented. But someone started the libmad documentation project and doxygen'd everything.

That got me most of the way there, but I was still having problems. I then used Google's Code Search to see how other people used the library and I eventually found some code that showed me what I was missing (libmad does not do internal buffering of the input stream, so you have to calculate how much it consumed and save what it didn't for the next iteration).

No comments: