0

I want to hear a recorded file when my iphone is on silent mode. For that I have implemented the following code.

-(void)viewWillAppear:(BOOL)animated{

    AudioSessionInitialize (NULL, NULL, NULL, NULL);
    AudioSessionSetActive(true);

    // Allow playback even if Ring/Silent switch is on mute
    UInt32 sessionCategory = kAudioSessionCategory_MediaPlayback;
    AudioSessionSetProperty (kAudioSessionProperty_AudioCategory, 
                             sizeof(sessionCategory),&sessionCategory);
}

I am unable to hear high pitched sound in iphone and in my ipad the sound effect button is enabled even when I am not able to hear any sound.

Before implementing above code I was able to hear recorded file. If you have any idea or code then share it

thanx in advance...

Dustin
  • 6,783
  • 4
  • 36
  • 53
kEvin
  • 411
  • 6
  • 18
  • 1
    I'm not sure the OS doesn't mute ALL of the audio players in silent mode... so what you want may be impossible. –  Aug 06 '12 at 12:42
  • @H2CO3: I have referred many links i.e.http://stackoverflow.com/questions/10322040/how-to-play-a-sound-using-avaudioplayer-when-in-silent-mode-in-iphone?rq=1 and http://stackoverflow.com/questions/9913712/ios-playing-audio-in-silent-mode?rq=1 etc. so I think its possible – kEvin Aug 06 '12 at 12:45

0 Answers0