通过 M-Audio ProFire 610 输出声音
我的工作任务是创建一个系统,该系统能够将声音引导到声卡的不同输出通道。我们使用的是M-Audio ProFire 610,它有8通道输出并通过火线连接。我们还使用 Mac Mini 作为我们的主机服务器,我将在 Xcode 中工作。
这是我正在构建的图表:
图表 http://img121.imageshack.us /img121/7865/diagramy.png
起初我认为Java足以完成这个项目,但后来我发现Java无法将声音推送到声卡默认输出通道以外的地方,所以我决定转向C++。问题是我是一名 Web 开发人员,而且我对这种语言没有任何经验 - 这就是为什么我正在向更有经验的开发人员寻求帮助。
我找到了适用于 ios4 的 Core Audio Primer,但不确定我可以使用多少内容项目。我也觉得有点混乱。
我应该采取哪些步骤来完成这项任务?我应该使用什么框架?有代码示例吗?我正在寻找任何帮助、提示、技巧——以及任何能帮助我完成这个项目的东西。
I got an assignment at work to create a system which will be able to direct sound to different output channels of our sound card. We are using M-Audio ProFire 610, which has 8 channel output and connects through FireWire. We are also using a Mac Mini as our host server and I'm gonna be working in Xcode.
This is the diagram of what I am building:
diagram http://img121.imageshack.us/img121/7865/diagramy.png
At first I thought that Java will be enough for this project, however later on I discovered that Java is not able to push sound to other than default output channels of the sound card so I decided to switch to C++. The problem is that I am a web developer and I don't have any experience in this language whatsoever - that is why I am looking for help from more experienced developers.
I found a Core Audio Primer for ios4 but not sure how much of it I can use for my project. I find it a bit confusing, too.
What steps should I take to complete this assignment? What frameworks should I use? Any code examples? I am looking for any help, hints, tips - well anything that will help me complete this project.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
如果您只是在寻找音频传递,您可能需要查看已经构建的内容,例如 Jack创建一个软件音频设备,其外观和工作方式与真实音频设备一样(您可以将其设置为应用程序的默认输出),然后允许您将每个通道路由到您想要的任何位置(包括路由到其他应用程序)。
如果你想/需要自己制作,一定要选择 C++,有很多教程(我从 cplusplus.com 学到的)。正如 Justin 提到的,CoreAudio 是低级 C/C++ 接口,但它确实很难学习和使用。 PortAudio 提供了一个更简单的 API,我在 Mac 实现上做了一些工作。查看那里的教程,为默认输入和输出制作类似的内容,然后使用
PaMacCore_SetupChannelMap
进行通道映射,具体描述为 此处。您需要调用它两次,一次针对输入流,一次针对输出流。如果您需要更多建议,请加入 PortAudio 的邮件列表!祝你好运!If you're just looking for audio pass-through, you might want to look at something that's already been built, like Jack which creates a software audio device that looks and works just like a real one (you can set it as default output for your app) and then allows you to route each channel anywhere you want (including to other applications).
If you want/need to make your own, definitely go with C++, for which there are many many tutorials (I learned from cplusplus.com). CoreAudio is the low-level C/C++ interface as Justin mentioned, but it's really hard to learn and use. A much simpler API is provided by PortAudio, for which I've worked a bit on the Mac implementation. Look at the tutorials there, make something similar for default input and output, and then to do the channel mapping use
PaMacCore_SetupChannelMap
, which is described here. You'll need to call it twice, once for the input stream and once for the output stream. Join the mailing list for PortAudio if you need more advice! Good luck!主要 API 位于 CoreAudio/AudioHardware.h
Apple 提供的大多数示例/支持代码都是 C++ 语言。然而,API 完全是 C 的(不知道这是否对你有帮助)。
您需要访问硬件抽象层(又名 HAL),更多详细信息请参阅此文档:
http://developer.apple.com/documentation/MusicAudio/Conceptual/CoreAudioOverview/CoreAudioOverview.pdf
(相当多的)其他示例/用法,请参阅
$DEVELOPER_DIR/Extras /核心音频/
the primary APIs are at
CoreAudio/AudioHardware.h
most of the samples/supporting code provided by apple is in C++. however, the APIs are totally C (don't know if that helps you or not).
you'll want to access the Hardware Abstraction Layer (aka HAL), more details in this doc:
http://developer.apple.com/documentation/MusicAudio/Conceptual/CoreAudioOverview/CoreAudioOverview.pdf
for (a rather significant amount of) additional samples/usage, see
$DEVELOPER_DIR/Extras/CoreAudio/