Hi All,
I am trying to play two .wav files in my appllication, but i am only able to play the first wav file , the second file is not at all playing.
I have added the AudioToolbox framework.
In my .h file i have included the Audiotoolbox.h file and has the following declarations
//Beep Sound
SystemSoundID soundFileObject;
SystemSoundID recycleFileObject;
In my .m file i am registering both the wav files as following
CFURLRef soundFileURLRef = CFBundleCopyResourceURL (CFBundleGetMainBundle (),CFSTR ("Beep"),CFSTR ("wav"),NULL );
AudioServicesCreateSystemSoundID (soundFileURLRef,&soundFileObject );
CFURLRef soundFileURLRef2 = CFBundleCopyResourceURL (CFBundleGetMainBundle (),CFSTR ("Recycle"),CFSTR ("wav"),NULL );
AudioServicesCreateSystemSoundID (soundFileURLRef2,&recycleFileObject );
And i have written two methods for playing each file individually.
-(void)playBeepSound
{
NSLog(@"Beep sound called : %d", soundFileObject);
AudioServicesPlaySystemSound (soundFileObject);
}
-(void)playRecycleSound
{
NSLog(@"Recycle sound called : %d", recycleFileObject);
AudioServicesPlaySystemSound (recycleFileObject);
}
But i am only able to play the Beep sound , but not the second sound wav file.
What is the error ???
Thanks