How to use usb speaker and built in audio speakers simultaneously on MAC OS X 10.6 using cocoa or anything else?

▼魔方 西西 提交于 2019-12-12 05:24:52

问题


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

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).

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

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

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!


回答1:


ok I got it myself...

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

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

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

Please find here how can you get audio device uid




回答2:


Cocoa has nothing to do with audio hardware management. If the features you need aren't in "Audio/MIDI Setup" and you don't understand the CoreAudio documentation, then there really aren't any other options for you beyond searching for a third-party product.



来源:https://stackoverflow.com/questions/1969090/how-to-use-usb-speaker-and-built-in-audio-speakers-simultaneously-on-mac-os-x-10

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!