I am using code like this:
CFURLRef fileURL = [self allocFullFileURL]; NSError *err; [audioPlayer release]; audioPlayer = [[AVAudioPlayer alloc] initWithContentsOfURL:(NSURL*)fileURL error:&err]; [audioPlayer prepareToPlay]; audioPlayer.delegate = self; [audioPlayer play]; CFRelease(fileURL);
to play a file on an iphone. This works just fine, but when i, e.g., add this to a button action, the first sound is always "not as loud" as the others. Like if the audio system is waking up, and the ol' amplifier needs to get warmed up...
Is that a known issue? If so, is there an easy workaround? Just curious, as the above looks pretty darn simple, so there might be a trap i walked in, but in another part of my code, i use AudioUnits with a multichannel mixer, and i have the same behavior there...
Tia
Frank |