Author Topic: IOS 5 Bass & volume control  (Read 6013 times)

Myrgy

  • Posts: 2
IOS 5 Bass & volume control
« on: 18 Jul '12 - 08:40 »
Hello, I develop iOS application and use bass for sound.
on iOS 4 I have had a problem: can't disable sound in application, when switch off sound.
I solve this problem using this code
Code: [Select]
- (void) applicationDidFinishLaunching: (UIApplication*) application
{
  ....
  SInt32  ambient = kAudioSessionCategory_AmbientSound;
  if (AudioSessionSetProperty (kAudioSessionProperty_AudioCategory, sizeof (ambient), &ambient))
  {
    NSLog(@"*** Error *** GBMusicTrack - initWithPath: could not set Session property to ambient.");
  }
}

after that all work fine on iOS 4.

but now on iOS 5 I have an interesting problem. After application started I can't change volume using volume buttons and can't mute sound, but after I minimize application and activate it, all works fine.

I try to use
Code: [Select]
BASS_SetConfig(BASS_CONFIG_IOS_MIXAUDIO, 1<<4); to set audio session property for iOS, but it didn't help.

I use BASS 2.4.9 for iOS.

Probably anybody solve this problem. Thanks for answers.
« Last Edit: 18 Jul '12 - 10:25 by Myrgy »

Ian @ un4seen

  • Administrator
  • Posts: 20401
Re: IOS 5 Bass & volume control
« Reply #1 on: 18 Jul '12 - 17:40 »
To have BASS enable the ambient session category, the BASS_CONFIG_IOS_MIXAUDIO option should actually be set to 4 (not 1<<4 which is 16). So please try this (before your BASS_Init call)...

Code: [Select]
BASS_SetConfig(BASS_CONFIG_IOS_MIXAUDIO, 4);

Myrgy

  • Posts: 2
Re: IOS 5 Bass & volume control
« Reply #2 on: 19 Jul '12 - 07:33 »
I try this variant
Quote
BASS_SetConfig(BASS_CONFIG_IOS_MIXAUDIO, 4);
..
BASS_Init(...);
but it didn't help.
Yesterday I run my application on IOS 6, all works fine.
I think it's IOS 5 specific bug.