本文介绍了如何在Mac OS X 10.6上使用可可粉或其他任何东西同时使用USB扬声器和内置音频扬声器?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我之前曾问过这个问题,但是 Jeff Atwood 将我的问题移到了superuser.com.我需要以编程方式回答...

I asked this previously but Jeff Atwood moved my question to superuser.com. I need a answer programmatically...

我想在MAC OS X 10.6上同时使用内置扬声器和USB扬声器.

I want to use built in speakers and usb speakers simultaneously on MAC OS X 10.6.

我想在这些文件上播放不同的文件(我不想在两个扬声器上播放相同的文件).

I want to play different files on these (I do not want to play same file on both speakers).

是否可以使用可可粉(QTMovie或其他产品?)或其他任何东西?

Is it possible using cocoa (QTMovie or something else?) or anything else?

我已经检查了portaudio的东西,但是却不知道它是如何工作的! :(

I have checked the portaudio thing but didn't get how this works! :(

我也曾尝试将一些数据发送到USB扬声器,但是从Apple网站下载的示例"USBSimple Example"无效!

I have also tried to send some data to the USB speakers but the sample "USBSimple Example" downloaded from apple's site didn't worked!

推荐答案

好,我自己明白了...

ok I got it myself...

NSSound *airplaneSound = [NSSound soundNamed:@"Aura Cleanse-1.wav"];

[airplaneSound setPlaybackDeviceIdentifier:theCFString];
[airplaneSound play];

我可以在setPlaybackDeviceIdentifier中传递音频设备uid,以在特定设备上播放此声音

I can pass the audio device uid in the setPlaybackDeviceIdentifier to play this sound on a particular device

请在此处找到您如何获取音频设备uid

Please find here how can you get audio device uid

这篇关于如何在Mac OS X 10.6上使用可可粉或其他任何东西同时使用USB扬声器和内置音频扬声器?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!

09-17 13:22