编程流音频可可在Mac上 [英] Programmatically stream audio in Cocoa on the Mac

查看:192
本文介绍了编程流音频可可在Mac上的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我如何去编程方式创建在Mac上使用可可音频流。为了让在Cocoa程序使用的核心框架,在Mac OSX上白噪声发生器说呢?

How do I go about programmatically creating audio streams using Cocoa on the Mac. To make, say a white-noise generator using core frameworks on Mac OSX in Cocoa apps?

推荐答案

使用<单向href=\"http://developer.apple.com/documentation/MusicAudio/Reference/CoreAudio/book_intro/chapter_1_section_1.html#//apple_ref/doc/uid/TP30001108-CH201-DontLinkElementID_85\"相对=nofollow> CoreAudio的 DefaultOutputUnit。

One way is using the CoreAudio DefaultOutputUnit.

您可以用参数如输出采样率,分辨率和输出采样格式配置。然后,您可以通过编程创建一个原始声波,并提供这输出单元。

You can configure it with parameters such as output sampling rate, resolution, and output sample format. Then you can programmatically create a raw sound wave and provide this to the output unit.

在看看这个例子你的机器上/开发/例子/ CoreAudio的/ SimpleSDK / DefaultOutputUnit /

Take a look at this example on your machine at /Developer/Examples/CoreAudio/SimpleSDK/DefaultOutputUnit/

它使用默认输出单元发挥编程呈现正弦波。使用为出发点,你可以写一个程序来渲染任何其他人的东西输出。

Which uses the default output unit to play a programmatically rendered sine wave. Using that as a starting point and you can write a routine to render any thing else to output.

这个位置在/开发/例子/ CoreAudio的/还包含吨的其他核心音频的例子。

This location at /Developer/Examples/CoreAudio/ also contains tons of other core audio examples.

这篇关于编程流音频可可在Mac上的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆