The audio part is very different from other systems I've hacked. The audio part of the Gnome SDK consists of GStreamer, PulseAudio and Canberra. GStreamer is a multimedia framework. PulseAudio is a lower level abstraction: receiving raw audio and shipping it to the sound card. Canberra is a simple library that allow you to play short sounds. To be fair, Canberra would probably have been the way to go if all I wanted was a beep, but, the long range goal is to make an audio engine rather like the Game Boy Advance, and Canberra isn't really built for that. So GStreamer or PulseAudio are the way forward.
So, step one for me -- my version of "hello world" -- is to create a PCM representation of a square wave and then play it. I tried GStreamer first over PulseAudio for no particular reason.
GStreamer Hates YouOK. A slight exaggeration. GStreamer is complicated because it is not an audio library, it is a multimedia framework designed to encode and decode every format under the sun, apply filters, mux, demux, encode, decode, recode. It has an underlying framework that generic, extensible, and somewhat self-documenting.
To ask it to do something as trivial as playing a raw audio wave is almost beneath its dignity, and it lets you know that by requiring you to build an entire audio framework to do anything at all.
So, I've suceeded in making a beep. I'm the greatest coder in the world, ever. Oh, you're not impressed? Then I'd like to see you try to extract wisdom from the unsorted pile of knowledge that are the GStreamer docs. I used GIO to make a stream out of a memory buffer that contained my raw PCM sound data, and then streamed that to ALSA using GStreamer.
Explore my code fumblings after the jump.