Search code examples
macosaudiodevicecapturemicrophone

Which /dev/... (devices) are the microphone and speaker in Mac OS X?


I have a MacBook Alluminium and I want to capture the microphone in a RAW format and output a RAW audio through the speakers, in a standard way, i.e., using the terminal with standard Unix commands and using the standard /dev/??? devices.

So, the question/s:

  • Which devices are the microphone and speakers? Those both should start with /dev/...

  • Are they different if they are built-in or external? Which ones? (Also they have to start with /dev/...)

If you know also the unix commands to print the microphone input and to write the output for speakers that would be extra points! :) (I want to capture it from mic, modify it -I got it-, and send it modified to speakers)

If you know also the Assembly instructions for OSX that would be the perfection! But the main questions are which are in the bulleted list.

Thanks!


Solution

  • As @duskwuff says, you probably won't have any joy trying to access sound devices using /dev devices on OS X.

    If, as you say in your comment above, your goal is cross-platform portability then perhaps PortAudio might be a solution.

    From their homepage:

    PortAudio is a free, cross-platform, open-source, audio I/O library. It lets you write simple audio programs in 'C' or C++ that will compile and run on many platforms including Windows, Macintosh OS X, and Unix (OSS/ALSA). It is intended to promote the exchange of audio software between developers on different platforms. Many applications use PortAudio for Audio I/O.

    On OS X I believe they use Core Audio and on Linux they use OSS/ALSA.