1 Star 0 Fork 0

yangwu / novocaine

加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
该仓库未声明开源许可证文件(LICENSE),使用请关注具体项目描述及其代码上游依赖。
克隆/下载
贡献代码
同步代码
取消
提示: 由于 Git 不支持空文件夾,创建文件夹后会生成空的 .keep 文件
Loading...
README

An analgesic for high-performance audio on iOS and OSX.

Really fast audio in iOS and Mac OS X using Audio Units is hard, and will leave you scarred and bloody. What used to take days can now be done with just a few lines of code.

Getting Audio

Novocaine *audioManager = [Novocaine audioManager];
[audioManager setInputBlock:^(float *newAudio, UInt32 numSamples, UInt32 numChannels) {
	// Now you're getting audio from the microphone every 20 milliseconds or so. How's that for easy?
	// Audio comes in interleaved, so,
	// if numChannels = 2, newAudio[0] is channel 1, newAudio[1] is channel 2, newAudio[2] is channel 1, etc.
}];
[audioManager play];

Playing Audio

Novocaine *audioManager = [Novocaine audioManager];
[audioManager setOutputBlock:^(float *audioToPlay, UInt32 numSamples, UInt32 numChannels) {
	// All you have to do is put your audio into "audioToPlay".
}];
[audioManager play];

Does anybody actually use it?

Yep. Novocaine is result of three years of work on the audio engine of Octave, Fourier and oScope, a powerful suite of audio analysis apps. Please do check them out!

A thing to note:

The RingBuffer class is written in C++ to make things extra zippy, so the classes that use it will have to be Objective-C++. Change all the files that use RingBuffer from MyClass.m to MyClass.mm.

Want some examples?

Inside of ViewController.mm are a bunch of tiny little examples I wrote. Uncomment one and see how it sounds.
Do note, however, for examples involving play-through, that you should be using headphones. Having the
mic and speaker close to each other will produce some gnarly feedback.

Want to learn the nitty-gritty of Core Audio?

If you want to get down and dirty, if you want to get brave and get close to the hardware, I can only point you to the places where I learned how to do this stuff. Chris Adamson and Michael Tyson are two giants in the field of iOS audio, and they each wrote indispensable blog posts (this is Chris's, this is Michael's). Also, Chris Adamson now has a whole gosh-darned BOOK on Core Audio. I would have done unspeakable things to get my hands on this when I was first starting.

Analytics

空文件

简介

Painless high-performance audio on iOS and Mac OS X 展开 收起
Objective-C
取消

发行版

暂无发行版

贡献者

全部

近期动态

加载更多
不能加载更多了
Objective-C
1
https://gitee.com/kongfu_yang/novocaine.git
git@gitee.com:kongfu_yang/novocaine.git
kongfu_yang
novocaine
novocaine
master

搜索帮助

53164aa7 5694891 3bd8fe86 5694891