• Stars
    star
    2,224
  • Rank 19,962 (Top 0.5 %)
  • Language
    Objective-C
  • License
    MIT License
  • Created about 12 years ago
  • Updated over 5 years ago

Reviews

There are no reviews yet. Be the first to send feedback to the community and the maintainers!

Repository Details

Painless high-performance audio on iOS and Mac OS X

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

More Repositories

1

Netflix-Prize

The code I used to get in the top #150 in the Netflix Prize
C
248
star
2

iPhoneFFT

A simple FFT library for the iPhone, based on Ooura's FFT code. You should now use Apple's built-in Accelerate library. This was made before Accelerate was released, so it's now irrelevant.
C
114
star
3

bayarea-dl-summerschool

Torch notebooks and slides for the Bay Area Deep Learning Summer School
Jupyter Notebook
97
star
4

AWNotification

Easy to use pop-up info view for the iPhone
Objective-C
51
star
5

conda-lua-recipes

Conda recipes for the Lua & Torch ecosystem
Shell
21
star
6

PyNURBS

A revival and update of Runar Tenfjord's NURBs toolbox for Python
Python
19
star
7

validata

Continuous integration for your data
Jupyter Notebook
5
star
8

nsgt

Non-stationary Gabor transforms (GitHub mirror of http://grrrr.org/research/software/nsgt/)
Python
5
star
9

cuda-tests

CUDA playground for home-grown renderers and rasterizers.
C
4
star
10

paralleltools

A summary of parallelizing moderate amounts of work in Python
Jupyter Notebook
4
star
11

Flow

Optical flow application in Cinder
C++
3
star
12

talks

3
star
13

Simworld

An easy-to-use 3D simulation environment in Python
Python
3
star
14

Backyard-Brains-iOS-App

Objective-C
2
star
15

jellyjellyjelly

JavaScript
1
star
16

Kinect-Mouse

Ye Olde Ancient Researche
C#
1
star
17

Here-and-Now

An iOS app exposing OpenBlock's API in both Map and List form
Objective-C
1
star
18

oScope-Website

1
star
19

Get-That-Paper

Harvard Bookmarklet for Journal Access
1
star
20

pypatent

Scrape patents from the USPTO
1
star
21

conda

Cross-platform, Python-agnostic binary package manager
Python
1
star