I set up an AVAudioRecorder instance the following way when my view loads:
AVAudioSession *audioSession = [AVAudioSession sharedInstance];
audioSession.deleg
Okay try this:
Make NSURL *soundFileURL
global for your class so you can access it anywhere in your class and set in the same way as you are now (except it would be soundFileURL = [NSURL fileURLWithPath:soundFilePath];
instead of NSURL *soundFileURL = [NSURL fileURLWithPath:soundFilePath];
.
Then change this
self.player = [[AVAudioPlayer alloc] initWithContentsOfURL:self.recorder.url error:&error];
to this
self.player = [[AVAudioPlayer alloc] initWithContentsOfURL:soundFileURL error:&error];