I want to use the same function in the application as VOYPI in iOS.
Play background sound during a call.
I used the code below to play the background sound during a call.
Link for reference application here .
NSString *soundFilePath = [[NSBundle mainBundle] pathForResource:self.bgAudioFileName ofType: @"mp3"]; NSURL *fileURL = [[NSURL alloc] initFileURLWithPath:soundFilePath ]; myAudioPlayer = [[AVAudioPlayer alloc] initWithContentsOfURL:fileURL error:nil]; myAudioPlayer.numberOfLoops = -1; NSError *sessionError = nil;
This code will play sound on the current carrier call using avaudioplayer.
I set the category AVAudioSessionCategoryMultiRoute.
With this category, the receiver will be able to listen to background sound during the current call of the operator from the application.
But there was one problem with this, it would create an echo on the receiver side.
Help me in this code.
source share