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

前端 未结 2 453
刺人心
刺人心 2021-01-04 21:28

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

相关标签:
2条回答
  • 2021-01-04 21:44

    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.

    0 讨论(0)
  • 2021-01-04 21:51

    None of them. Not all devices have /dev nodes on Mac OS X, and audio devices are not among them. There is no way I'm aware of to access audio devices using only "standard" terminal commands. sox can be used if you install it, but it is not shipped with Mac OS X.

    The primary supported API to access audio devices on Mac OS X is Core Audio. Third-party libraries, such as libao, are also available which can expose a simpler, platform-independent interface to Core Audio.

    0 讨论(0)
提交回复
热议问题