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)
{
...
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...
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...
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...
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...
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 ...