我正在尝试写一个C++程序,播放实时处理的音频。我已经决定使用RtAudio,但是不能让测试程序播放音频。
我使用的是Mac,所以我使用./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).如何解决这个问题?
发布于 2011-07-30 16:36:53
你用的是Lion (10.7)吗?我看到了同样的问题,在较老的系统(10.6.x)上,RtAudio对我来说工作得很好。
也许你可以降级到RtAudio 4.0.6,这对我在Lion上是有效的,但仍然潜伏着一个关于设备名称的bug,在4.0.8中得到了修复。
https://stackoverflow.com/questions/6656967
复制相似问题