Where to start with Sound?

Member
Posts: 281
Joined: 2009.04
Post: #16
Quote:To call Carbon's future even "uncertain"
This worries me. Does Cocoa support C, or do I *sigh* have to learn ObjC?

~ Bring a Pen ~
Quote this message in a reply
Moderator
Posts: 1,560
Joined: 2003.10
Post: #17
Learning Objective-C will certainly make your life easier. It's not at all difficult, though; if you understand C, you can pretty much pick up Objective-C in an evening or two. Learning your way around Cocoa takes a little bit more time, but the documentation is pretty good.
Quote this message in a reply
Moderator
Posts: 1,560
Joined: 2003.10
Post: #18
So, rather than paste dubious snippets of OpenAL code, I'll just give you a link to the whole project: http://sacredsoftware.net/software/water...rce.tar.gz

The stuff you want is in Sound.c/h. Hopefully usage will be reasonably clear. As an added bonus, this also demonstrates libvorbisfile usage.

Let me know if you have any questions about the code. Good luck!
Quote this message in a reply
Member
Posts: 281
Joined: 2009.04
Post: #19
I tried it, but It won't work.

• I don't want to play ogg.
• your OpenAL.framework is different to mine.
• The entire 'vorbis' thing won't work.
• Sad

I don't see it. Xcode gave me 63 errors even with all the frameworks/folders. SadSad

~ Bring a Pen ~
Quote this message in a reply
Moderator
Posts: 1,560
Joined: 2003.10
Post: #20
Hmm, looks like this code is old enough by now that the latest Xcode doesn't even recognize its project file (in fact, it's a Project Builder project). Nevertheless, the OpenAL code should still be relevant as an example. OpenAL takes raw waveform data as input, so libvorbisfile can easily be swapped out for something else.
Quote this message in a reply
Moderator
Posts: 623
Joined: 2007.09
Post: #21
mikey Wrote:This worries me. Does Cocoa support C, or do I *sigh* have to learn ObjC?

Why the sigh? Objective C is easy to learn. And you don't have to write your whole project in Objective-C - just the Cocoa parts.

- Lincoln Green
http://www.binkworks.com/
Quote this message in a reply
Member
Posts: 281
Joined: 2009.04
Post: #22
Quote:Why the sigh? Objective C is easy to learn.

Ahh. my experiences are much different. Smile But I'll try again.
Quote:And you don't have to write your whole project in Objective-C - just the Cocoa parts.

Ahh, what Cocoa parts?
Also, what's a class?
What's an object? (A function?) Huh

~ Bring a Pen ~
Quote this message in a reply
Moderator
Posts: 3,571
Joined: 2003.06
Post: #23
Hey mikey, I just released a new sound effects library for the Mac, specifically geared for folks like you just trying to get basic sound effects going. I had you in mind while I was putting it together, so maybe you'll find it helpful. You can check out the thread here.
Quote this message in a reply
Member
Posts: 281
Joined: 2009.04
Post: #24
Wow, thanks loads! I got a sound up and running in <1 minute!

~ Bring a Pen ~
Quote this message in a reply
Moderator
Posts: 3,571
Joined: 2003.06
Post: #25
mikey Wrote:Wow, thanks loads! I got a sound up and running in <1 minute!

Cool! Glad it works for you so far. Smile
Quote this message in a reply
Post Reply