Using Core Audio to extract float from default lin

2019-09-16 02:48发布

问题:

I am in need for some assistance/guidance with using Core Audio to extract floats from the sound out device. I have read similar posts regarding the extraction of floats from AIFF. My end goal is something along the lines of:

  • iTunes is playing a song

  • C/C++ program using Core Audio extracts float values from the sound device (in real-time)

  • Use resulting float vector to perform Fourier Transformation on a array of floats (probably using vDSP from Apple's Accelerate Library) - This part I have somewhat figured out :)

Note: I am developing on Mac OS X (10.6+).

Any help will be much appreciated.

回答1:

This question comes up frequently on the Core Audio mailing list. There is no easy way to accomplish what you want to do. See:

http://lists.apple.com/archives/coreaudio-api/2007/Jul/msg00066.html http://lists.apple.com/archives/coreaudio-api/2009/Nov/msg00308.html

You'll need to write either a kext or a user-land driver.