completely rewriten not to depend on Apple CoreAudio components