• 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
Re: Error when adding AVAudioPlayer to SpeakHere sample
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

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
  • Follow-Ups:
    • Re: Error when adding AVAudioPlayer to SpeakHere sample
      • From: Andrew Nalband <email@hidden>
References: 
 >Error when adding AVAudioPlayer to SpeakHere sample (From: Andrew Nalband <email@hidden>)

  • Prev by Date: Re: Reporting MIDIServer process crashes
  • Next by Date: RE: Audio queues...again
  • Previous by thread: Error when adding AVAudioPlayer to SpeakHere sample
  • Next by thread: Re: Error when adding AVAudioPlayer to SpeakHere sample
  • Index(es):
    • Date
    • Thread