nssound

How to fade an NSSound object

I've written a cheap & cheerful sound board in for my Mac, and I play the various sounds with NSSound like this: -(void)play:(NSSound *)soundEffect:(BOOL)stopIfPlaying { BOOL wasPlaying = FALSE; if([nowPlaying isPlaying]) { [nowPlaying stop]; wasPlaying = TRUE; } if(soundEffect != nowPlaying) { ...

What's the SIMPLEST way to play a sound clip in an iPhone app?

I want to be able to play a sound clip in an iPhone OS app. I've seen info on both NSSound as well as AVFoundation as being means for getting sound clips played on an iPhone OS device, but I'm still not clear on the subject and could use some help. No need to spell it out for me step-by-step in actual code, but if someone could give me a...

How to play a mp3 file from within the Resources folder of my application ?

I am making an app that will play sound on events but I can't figure out how to access files from the ressources folder of the Application. Here is what I'm doing : NSSound *player = [[NSSound alloc] initWithContentsOfFile:@"Sound.mp3"] byReference:NO]; [player play]; But it's not working at all. If I put a full length path it wil...

NSSound undeclared on iPhone?

sound = [[NSSound alloc] initWithContentsOfFile:@"staticbeam09.wav" byReference:YES]; Code referenced from Apple docs. Getting an error when I put this in viewDidLoad. If I put NSSound *sound; in the header file, I get the specifier-qualifier error at the top of my implementation file. What do I have to do to make this work? I was j...

How to prevent/deal with a crash when playing a corrupt MP3 with NSSound

Hello, As my program allows the user to import any .mp3 file into their library, there is a possibility that they might try to play an mp3 that is in someway corrupt. My audio player uses NSSound to play the file and currently when presented with a dodgy mp3 file it crashes with an EXC_ARITHMETIC exception. A brief look on this site tol...

NSSound-like framework that works, but doesn't require dealing with a steep learning curve

Hi, I've pretty much finished work on a white noise feature for one of my applications using NSSound to play a loop of 10 second AAC-encoded pre-recorded white noise. [sound setLoops: YES] should be all that's required, right? It works like a charm but I've noticed that there is an audible pause between the sound file finishing and ...