iDevGames Forums
Sound from disk in Carbon? - Printable Version

+- iDevGames Forums (http://www.idevgames.com/forums)
+-- Forum: Development Zone (/forum-3.html)
+--- Forum: Game Programming Fundamentals (/forum-7.html)
+--- Thread: Sound from disk in Carbon? (/thread-7313.html)



Sound from disk in Carbon? - Fenris - Feb 12, 2003 03:38 PM

Gah... Sound programming is obviously not for me. Could anyone help me out with these questions?

Is there a way to play a sound loaded from disk in Carbon (I guess this has something to do with Get1Resource) and not having to store all the sounds in one resource file? (I would like to store all the sounds for one level in one file (preferrably packed together with the other files, but that's another worry. If anyone has suggestions towards this, they are welcome.)

Is it too slow to use Quicktime MP3:s for every sound effect in the game? (I would think so...)

What's a good strategy for playing sound effects in a game? Any tips, give them to me! Smile


Sound from disk in Carbon? - belboz - Feb 12, 2003 03:53 PM

I like SDL in combination with SDL_mixer. I believe you can initialize just the audio port of SDL if you don't want the video portions.

What about OpenAL? I haven't looked into it. But have heard good things about it from others.


Sound from disk in Carbon? - OneSadCookie - Feb 12, 2003 03:59 PM

If you want to load sound resources from different resource files, you just need to change the current resource file as you're loading the resources.

I don't remember what the functions are called, but you should be able to find out by looking at Resources.h or the Resource Manager documentation...

Of course, you shouldn't be using resources at all...


Sound from disk in Carbon? - belboz - Feb 12, 2003 03:59 PM

There is also mikmod

http://www.mikmod.org/

There is an OS X port of it. I believe it supports carbon.


Sound from disk in Carbon? - Fenris - Feb 12, 2003 04:02 PM

Quote:Originally posted by OneSadCookie
Of course, you shouldn't be using resources at all...


No, which is why I'm asking for alternatives. Smile I'm inclined towards SDL, though... I'll look into it, thanks!


Sound from disk in Carbon? - szymczyk - Feb 12, 2003 10:38 PM

Quote:Originally posted by Fenris
Is there a way to play a sound loaded from disk in Carbon (I guess this has something to do with Get1Resource) and not having to store all the sounds in one resource file? (I would like to store all the sounds for one level in one file (preferrably packed together with the other files, but that's another worry. If anyone has suggestions towards this, they are welcome.)

What's a good strategy for playing sound effects in a game? Any tips, give them to me! Smile

If you use bundles, it's easy to have one resource file per level so you don't have to store all the sounds in one file. In Project Builder, you add the resource files to your project, then move the files into the Resource Manager Resources section (you do this in your build settings). I haven't made bundles with CodeWarrior, but the process is probably similar. As OneSadCookie said, you change the current resource file to load the new sounds you want to play.

For sound effects, QuickTime and snd resources are the easiest to program. I would use snd resources for sound effects and QuickTime for music.


Sound from disk in Carbon? - Fenris - Feb 12, 2003 10:43 PM

Hi Mark!

Yep, I went with your book - I always keep it around - QuickTime all the way. (For now, at least) Thanks, though!