PDA

View Full Version : multiply NSSounds at once?


honkFactory
2004.07.05, 05:07 PM
Is it possible for NSSound to play more than one wave at a time? It seems that a sound won't start to play until the previous one has finished.

kelvin
2004.07.05, 07:09 PM
I'd recommend just using quicktime. If you're looking for an easy to use Cocoa/Quicktime movie(takes sound files) wrapper Have a look at the CocoaBlitz (http://www.variableaspect.com/experiments/CocoaBlitz/) source. Specifically the CBMovie class.

honkFactory
2004.07.05, 09:06 PM
NSMovie, unlike NSSound, will allow you to play multiple sounds at the same time?

kelvin
2004.07.05, 09:33 PM
NSMovie plays better when loading multiple sounds. You're still going to need multiple instances of NSMovie. And with NSMovie you're going to need to control quicktime somehow (which is what CBMovie does for you).

Jake
2004.07.05, 10:01 PM
It always works for me, I always have a song playing and then 1 sound effect with NSSound

honkFactory
2004.07.05, 10:44 PM
Kelvin: Thanks. It took me a while to see what you where doing there. I am still a little unsure of why it is necessary for NSTimer to play a quicktime movie but it works!

Jake: I wish I could say the same. The problems that I was having with NSSound as the same problems that I experience when I play project 32 from nehe.org. If i played sounds to close to each other the second sound would get dropped. Too bad. Using NSSound is so much cleaner than using quicktime in cocoa.