Lower volume from AVPlayer after I answer a call

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 




Hello all,
I am using AVAudioPlayer to play a sound in a loop when i get an incoming call from pjsip. I noticed that when I deploy a fresh copy of my code to a device i hear the volume high and clear every time i call the device.. but at the moment i answer a call and let PJSIP does it thing to connect the phone speaker ...etc, i noticed that every time i call after this point the volume from AVAudioPlayer goes down, to summarize:
- Start the App for the first time.- Call the device.- My app will ring and volume will be ok.- Do not answer and hangup.- Try to call again.- My app will ring and volume will be ok.- Do not answer again and hangup.- If i kept doing this i will see no problem and my AVAudioPlayer will play my ring tone loud and clear.- Now call the device again and answer.- The call will be connected with no problem. hangup now.- Try to call at this point. the AVAudioPlayer will play the sound really low at this point !!
any ideas?? I think PJSIP is doing something when i connect a call.. the way i am starting PJSIP is similar to the PJSUA examples and i am defaulting most of the configs..
I am using this code to play the ring tone in my ViewController that i show when i get an incoming call notification from PJSIP:










        NSURL* musicFile = [NSURL fileURLWithPath:[[NSBundle mainBundle] 
                                                   pathForResource:@"ring"
                                                   ofType:@"caf"
                                                   inDirectory:@"SystemSounds"]];








        audioPlayer = [[AVAudioPlayer alloc] initWithContentsOfURL:musicFile error:nil];  // audioPlayer is defined in my view controller *.h 
        audioPlayer.numberOfLoops = -1;
        audioPlayer.volume = 1.0;    
        
        [audioPlayer play];    
        
Thanks,,,AsH







 		 	   		  
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.pjsip.org/pipermail/pjsip_lists.pjsip.org/attachments/20120127/a7a7512b/attachment.html>


[Index of Archives]     [Asterisk Users]     [Asterisk App Development]     [Linux ARM Kernel]     [Linux ARM]     [Linux Omap]     [Fedora ARM]     [IETF Annouce]     [Security]     [Bugtraq]     [Linux]     [Linux OMAP]     [Linux MIPS]     [Linux API]
  Powered by Linux