2

I would like to do some fairly simple audio programming on OS X (using Lion and Xcode 4.3) -- synthesizing tones with given frequencies, mainly. Trouble is, Apple's documentation on the subject is way too high-level for my current knowledge of the subject. I've searched for weeks now for something that will get me started, to no avail.

Does anyone know of some Core Audio basic tutorial, or even some sample code, that will help me do fairly simple Core Audio tasks so that I can progress to understanding the Apple documentation?

ThinkingStiff
  • 64,767
  • 30
  • 146
  • 239

2 Answers2

4

I would suggest the book Learning Core Audio There is also sample code from the book at that site.

spring
  • 18,009
  • 15
  • 80
  • 160
  • Thanks! I'd seen the book but was hoping for a less money-costing solution. I think I'll have to get that book next time I get money... – Mauro Braunstein Jul 03 '12 at 04:51
  • Trust me, it is worth the $. Wish it went further but it's a good start. The author also has a blog where he drops code from time to time: http://www.subfurther.com/blog/ – spring Jul 03 '12 at 04:55
1

If you are looking to synthesize audio fairly easy, you are going to want to use a 3rd party library. Two possible solutions are FMOD and SuperCollider.

The pros and cons between the two are really that supercollider runs as a server that you can connect from app as a client and FMOD is compiled into an app and uses core audio to synthesize the sound. FMOD is clearly the choice if you are planning on distributing this app. SuperCollider also has it's own language that you'd have to learn the basics of to start tailoring your sounds synthesis. Here are some links:

FMOD:

FMOD Downloads (Comes with a bunch of sample code)

Super Collider:

SC Server Download

Sine Wave Generator Sample App

Great source of SC scripts and examples

ezekielDFM
  • 1,947
  • 13
  • 26
  • Thank you! I do want something that I can compile into my app, though FMOD's licensing scheme means that I can't distribute it, which I'd like to get to do eventually. Since I asked this question I also learned about PortAudio and was able to follow the tutorial to write a simple sound-playing app. Any thoughts on that library? – Mauro Braunstein Jul 03 '12 at 05:02
  • I haven't had the pleasure of using that PortAudio yet. Definitely looks solid and i'm interested in trying it. I had used SuperCollider on some standalone experiments. I used FMOD for iOS app, but the app was free and did not contain any ads so i was able to use the non-commercial license. – ezekielDFM Jul 03 '12 at 14:03