added some sample code from the Apple CoreAudio Utility classes