当前是否有任何 API(公共或私有)允许第三方 Mac OS X 应用程序将音频流式传输到 AirPlay 接收器?Rogue Amoeba Software 的Airfoil似乎能够做到这一点,Erica Sadun 的AirFlick 也是如此,但我找不到任何可以演示如何做到这一点的源代码。任何指针表示赞赏!
6 回答
事实证明,从OS X 10.8开始,AirPlay 音频流可以使用公共 API,但在任何地方都没有真正记录。Joris Kluivers 写了一篇很棒的博客文章,介绍了如何实现它。
这是一个开源的 ruby 实现。这很简单。https://github.com/elcuervo/airplay
Mountain Lion (OS X 10.8) 在声音设置中添加了 AirPlay 支持。用户可以选择将本地声音输出发送到 AirPlay 设备。但是,我认为您无法访问应用程序中的任何 API。
有一些库可用于实现 AirPlay,但要知道,如果您尝试在 App Store 上发布您的应用程序,Apple 会拒绝您的应用程序。至少,这就是发生在我身上的事。
我写了一个 node.js 模块来支持 AirPlay。即使您不使用节点,您也可以通过标准输入管道传输您的音频数据。
Someone recently managed to obtain the AirPlay private key which allows you to have your program listed in the AirPlay menus on devices on your network.
You can read about it here. There is also an open source project linked from that page. http://mafipulation.org/blagoblig/2011/04/08#shairport
Be aware that obviously any application you create will never be approved by apple and the private key could potentially be changed in a firmware/software update.
我不认为它可用。至少在 10.7 之前的版本中没有。
我猜 Airfoil 使用了类似于 DVD John 不久前破解 Airport Express 密钥有效载荷时所做的事情。他发布了代码(C#),你应该可以找到它,但它非常神秘。
我不知道 AirFlick 使用什么,但你总是可以尝试 ping Erica,她通常会分享她的东西。