For a working example, take a look at the last part of the audio tutorial.

https://www.pjrc.com/store/audio_tutorial_kit.html

That part starts on page 30 of the PDF. In the walkthrough video,...