Where to start with Sound?
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 ~
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.
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!
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!
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.
•
I don't see it. Xcode gave me 63 errors even with all the frameworks/folders.
• I don't want to play ogg.
• your OpenAL.framework is different to mine.
• The entire 'vorbis' thing won't work.
•

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

~ Bring a Pen ~
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.
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.
Quote:Why the sigh? Objective C is easy to learn.
Ahh. my experiences are much different.
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?)
~ Bring a Pen ~
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.
Wow, thanks loads! I got a sound up and running in <1 minute!
~ Bring a Pen ~
mikey Wrote:Wow, thanks loads! I got a sound up and running in <1 minute!
Cool! Glad it works for you so far.

