

Novocaine: painless high-performance audio on iOS and OS X - alexbw
http://alexbw.github.com/novocaine/

======
alexbw
Hey everybody, Novocaine is my baby, and it's completely awesome to see folks
already using it.

For the record, it's open-source, I just forgot to stick the MIT license at
the top. Or would folks prefer BSD? Let me know, I'm flexible. The only thing
I care about is that people use it to make awesome software.

If anybody's a Boston local, I'll be talking about iOS audio (both novocaine
and some fancier frequency analysis, I hope) at the Berklee College of Music
CS club tomorrow, 6-8pm, at 150 Mass Ave, room 118.

And, if you dig novocaine, check out the apps I made with it:
<http://itunes.apple.com/us/artist/alex-wiltschko/id344345862>

~~~
sandGorgon
How I wish people could build such things for Linux.

Here's a question - what does Linux audio lack for you to be able to pull of
something like Novocaine ?

~~~
coob
In addition, does Android still suck for low latency audio?

~~~
j_s
Yes.

<http://code.google.com/p/android/issues/detail?id=3434>

------
ianloic
Is this open source? The source files say All Rights Reserved.

~~~
alexbw
Fixed.

------
melloclello
Oh my god. I just spent the last month on and off trying to wrap my head
around CoreAudio. I'm flabbergasted, thank you so much.

~~~
melloclello
Update: worksforme on Mac and iOS, going to start playing with this tonight

------
kscottz
This looks great. Most audio and image processing libraries are a pain and I
always end up wrapping them in something like this. It is nice to see someone
open source a well written wrapper.

------
vecter
Whoa this look great! I haven't had a chance to dig through, but is it
possible to capture the audio that's being played? I'm thinking of recording
gameplay audio. Thanks!

------
radarsat1
Ah, interesting, reminds me of RtAudio. (Similar thing for C++, though this
seems to require even less boilerplate.. on the other hand RtAudio is cross-
platform.)

------
bludwype
just bought all your apps. any other useful and/or interesting and/or fun
audio analysis apps out there anyone can recommend??

~~~
kennywinker
[http://itunes.apple.com/ca/artist/audioforge-labs-
inc./id305...](http://itunes.apple.com/ca/artist/audioforge-labs-
inc./id305996692)

Made by a developer I met at WWDC. Good stuff and he puts a whole lot of love
into them.

------
psych
Is it possible with Novocaine to mix for example in app audio and mic
recording into one sound file?

Cheers

------
guscost
I just finished making my own version of this! What unfortunate timing, but
kudos to you.

~~~
melloclello
Is it open source? I'd love to check it out.

~~~
guscost
I'm thinking of abstracting out some of the quirks and open-sourcing the audio
engine at some point, but it isn't nearly as intuitive or compatible as this
library as it was developed recently along with the application that uses
it...

On top of that, no vector operations or ring buffers are currently
implemented, so I wouldn't be surprised if this library has significantly
better performance. I do have a bit of a wish list of features to add to my
code after taking a look at some of the techniques used here. It's complicated
work, but I've never had a better experience learning a complicated system.

My implementation basically added a playback and mixing interface to the audio
engine from this sample mixer project:
[http://developer.apple.com/library/ios/#samplecode/MixerHost...](http://developer.apple.com/library/ios/#samplecode/MixerHost/Introduction/Intro.html)

~~~
andyzweb
By vector operations do you mean using something like the Accelerate
framework? or SSE/NEON primitives? or just retooling your code so that your
compiler can make attempts to vectorize when possible?

~~~
guscost
I'm a bit new to this stuff, so I'm not exactly sure to be honest! It looks
like he is piping several array operations through Accelerate, and I suspect
there is at least one part of my render callback function that would finish
faster with appropriate vectorization.

If anyone has any relevant tips about how the Obj-C LLVM or whatever it is
actually works and what it means for low-latency audio, please do share. My
current strategy is ruthless and minimal static allocation but I don't know
what is best.

------
hackermom
Correct me if I'm wrong, but isn't Novocaine still an abstraction layer that
interfaces with Core Audio (I haven't had a moment to look at the sources
yet)? I understand that it's simpler to deal with, but how is it more "high-
performant" than working with Core Audio directly?

~~~
kennywinker
I think he means "painless" in comparison with working directly with audio
units, and "high-performance" in comparison with the higher-level abstractions
provided by Apple.

Having tried my hand at core audio code a few times, this is an amazingly
simple API. I've got some app ideas I'd like to use this in.

------
SpiderX
Absolutely hate the name.

~~~
BrandonBT
Why do you hate it?

~~~
SpiderX
Because it gives you absolutely no idea what the product actually does, and
it's un-googleable. Try googling novocaine - guess what, you won't find this
in the first page of results. Good luck with it. I'm sure it may be one
awesome piece of software, but the name is just dumb.

~~~
elithrar
> Try googling novocaine - guess what, you won't find this in the first page
> of results. Good luck with it. I'm sure it may be one awesome piece of
> software, but the name is just dumb.

A lot of web projects are "un-googleable", especially when they are first
kicking off. Django would be a good example of this—searching for "Django"
would often return results about Django Reinhardt, a jazz musician, instead of
the web framework.

I think it's a fair assumption to say that an interested programmer might
think to append github[1] or audio[2] to their search, in which case the
result is in the top 3.

[1] <https://duckduckgo.com/?q=novocaine+github> [2]
<https://duckduckgo.com/?q=novocaine+audio>

~~~
podperson
I'm thinking TotallyUnofficialNewExcitingSimpleAudioKit -- TUNESAK.

