• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
Error when adding AVAudioPlayer to SpeakHere sample
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Error when adding AVAudioPlayer to SpeakHere sample


  • Subject: Error when adding AVAudioPlayer to SpeakHere sample
  • From: Andrew Nalband <email@hidden>
  • Date: Tue, 28 Apr 2009 00:56:45 -0400

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
  • Follow-Ups:
    • Re: Error when adding AVAudioPlayer to SpeakHere sample
      • From: William Stewart <email@hidden>
  • Prev by Date: Re: Audio queues...again
  • Next by Date: Reporting MIDIServer process crashes
  • Previous by thread: Should I use QuickTime?
  • Next by thread: Re: Error when adding AVAudioPlayer to SpeakHere sample
  • Index(es):
    • Date
    • Thread