我正在尝试编写一个播放实时处理音频的C ++程序。我决定使用RtAudio,但不能让测试程序播放音频。
我使用的是Mac OS X,因此我使用./configure --with-core
和make
进行了编译。在编译测试目录中的文件后,我运行./audioprobe
以返回此列表。
Compiled APIs:
OS-X Core Audio
Current API: OS-X Core Audio
Found 3 device(s) ...
Device Name = Apple Inc.: Built-in Microphone
Probe Status = Successful
Output Channels = 0
Input Channels = 2
Duplex Channels = 0
This is NOT the default output device.
This is NOT the default input device.
Natively supported data formats:
32-bit float
Supported sample rates = 44100 48000 88200 96000
Device Name = Apple Inc.: Built-in Input
Probe Status = Successful
Output Channels = 0
Input Channels = 2
Duplex Channels = 0
This is NOT the default output device.
This is the default input device.
Natively supported data formats:
32-bit float
Supported sample rates = 44100 48000 88200 96000
Device Name = Apple Inc.: Built-in Output
Probe Status = Successful
Output Channels = 2
Input Channels = 0
Duplex Channels = 0
This is the default output device.
This is NOT the default input device.
Natively supported data formats:
32-bit float
Supported sample rates = 44100 48000 88200 96000
由于内置输出设备是索引2,然后我运行了./playsaw 2 44100 2
,但发生了错误:
RtApiCore::probeDeviceOpen: system error (kAudioHardwareUnknownPropertyError)
getting stream format for device (2).
如何解决这个问题?
答案 0 :(得分:1)
你是狮友(10.7)吗?我看到同样的问题,在较旧的系统上(10.6.x)RtAudio对我来说很好。
也许你可以降级到RtAudio 4.0.6,这对我来说对Lion有用,但是仍然存在一个潜伏在设备名称中的错误,这些错误已经在4.0.8中得到修复。