Home › Forums › OpenEars › OpenEars/Pocketsphinx turns audio player volume down and won't let go › Reply To: OpenEars/Pocketsphinx turns audio player volume down and won't let go
Thanks for the reply, Halle. I’ll take a look at the PlayAndRecord posts.
I am using AVAudioPlayer for all my sounds/audio and the volume is still getting sacked (unless I’m doing something wrong). Below is my code for the background sounds:
AVAudioPlayer *_backgroundSoundPlayer; //declared at the top of the implementation
– (void)playBackgroundSound:(NSString *)filename
{
NSError *error;
NSURL *backgroundSoundURL = [[NSBundle mainBundle] URLForResource:filename withExtension:nil];
_backgroundSoundPlayer = [[AVAudioPlayer alloc] initWithContentsOfURL:backgroundSoundURL error:&error];
_backgroundSoundPlayer.numberOfLoops = -1;
_backgroundSoundPlayer.volume = vB;
[_backgroundSoundPlayer prepareToPlay];
}
[_backgroundSoundPlayer play]; //this gets called in another method
What other workarounds are you looking at, and could I help test them?
Thanks again.