Re: Error when adding AVAudioPlayer to SpeakHere sample
Re: Error when adding AVAudioPlayer to SpeakHere sample
- Subject: Re: Error when adding AVAudioPlayer to SpeakHere sample
- From: William Stewart <email@hidden>
- Date: Tue, 28 Apr 2009 13:05:08 -0700
all that the error is saying here is that the audio session is already
initialised I think - try just ignoring the result of
AudioSessionInitialise in the speak here controller
On Apr 27, 2009, at 9:56 PM, Andrew Nalband wrote:
Hello All,
I have been trying to work with the SpeakHere sample code, and I'm
just trying to add an AVAudioPlayer to play a sound file when the
level peaks. I'm adding the AVAudioPlayer as a member of the
AQLevelMeter class:
AVAudioPlayer * myAudioPlayer;
And adding this in the "(id)initWithCoder:(NSCoder *)coder" method:
///////////////
///////////////
NSString *soundFilePath = [[NSBundle mainBundle] pathForResource:
@"tone" ofType: @"wav"];
NSURL *fileURL = [[NSURL alloc] initFileURLWithPath: soundFilePath];
myAudioPlayer = [[AVAudioPlayer alloc] initWithContentsOfURL:
fileURL error: nil];
[fileURL release];
[myAudioPlayer prepareToPlay];
////////////////
////////////////
I'm getting this error:
ERROR INITIALIZING AUDIO SESSION! 1768843636
which I believe is coming from awakeFromNib in SpeakHereController.h
and this:
terminate called after throwing an instance of 'CAXException'
when I press the stop button. Is there some conflict with using
AVAudioPlayer here?
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Coreaudio-api mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Coreaudio-api mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden