1

I have a Cocos2D(Box2D) project that contains AVAudioRecorder object (Microphone Listening). I've not problem with audio in iPhone 4, but the audio volume in iPhone 3G is very low! I did increase device volume to the max volume but the audio volume still not changed.

Lightness Races in Orbit
  • 378,754
  • 76
  • 643
  • 1,055
Younes Jafari
  • 251
  • 1
  • 5
  • 17

1 Answers1

1

I found the problem! The audio volume is low cause audio played in phone call speaker (not main speaker).

To play audio in main speaker we need this code:

UInt32 doChangeDefaultRoute = 1;     
AudioSessionSetProperty(
   kAudioSessionProperty_OverrideCategoryDefaultToSpeaker,
   sizeof(doChangeDefaultRoute),
   &doChangeDefaultRoute
);
Lightness Races in Orbit
  • 378,754
  • 76
  • 643
  • 1,055
Younes Jafari
  • 251
  • 1
  • 5
  • 17