How to set the ZEGOCLOUD SDK so that the other end cannot hear the sound of the music played by the other end - zegocloud

I built a video call app using ZEGOCLOUD's SDK.
When A (using an oppo phone) and B are talking, A wears the headset and uses the music player to play music, then B can hear the music played by A, I want B to listen no music.
How should it be set up?

The echo cancellation function can be turned on.
enableAECWhenHeadsetDetected = true
Indicates that echo cancellation is enabled in headphone mode.

Related

Missing sound on Apple Watch after resume from dock

I am using the following sounds (all 32K AAC as mentioned in Apple document but I use mono instead of stereo: https://developer.apple.com/library/content/documentation/General/Conceptual/WatchKitProgrammingGuide/AudioandVideo.html) for my watchOS 3 games.
let hitSound = SKAction.playSoundFileNamed("hit.m4a", waitForCompletion:false)
let explosionSound = SKAction.playSoundFileNamed("explosion.m4a", waitForCompletion:false)
let music = SKAudioNode(fileNamed: "delta.m4a")
I use hitSound and explosionSound for short sound effect, and play music on the background, they works fine until the game is quit and resume from dock.
The music is resume and the sound effects are no longer heard. Is there any problem with using SKAction.playSoundFileNamed to play sound?

play sound while app in call and speaker is occupied by call

My app is a calling app and I want to play a mp3 file during the call (call in my app not the iphone voice call). AvAudioPlayer play return YES so it means sound is played but I do not hear the sound played.
the mp3 file I want to play is a simple small beep sound which I want to play to inform the caller during the call.
Any idea why I can not hear the sound or is there a way for this.
thanks a lot.

Not getting sounds for Notifications or Messages in my Audio app when music is playing | AVAudioPlayer

I have an Audio app using AVAudioPlayer on iOS. Whenever music is playing my app and a new notification or a message comes, my player continues playing and there is no notification sound for the message.
I want that it should work in similar way default music app in iOS works, whenever a new message or notification comes music sound ducks for a while and notification sound is played and after that music starts playing normally again.
I read that setting kAudioSessionProperty_OverrideCategoryMixWithOthers to true should fix it as it allows mixing of sounds. I tried that as well, but it doesn't work and this also allows my app to play music along with other apps which I don't want.
All I want is whenever a message or notification comes when my app is playing music, I should get a notification sound and my app then continues playing.
Any help would be appreciated!
Finally after a lot of try I figured it out, I had set AVAudioSessionCategoryPlayAndRecord property which was causing the above error I mentioned. removing that fixed the issue

Play 2 songs simultaneously,one should play only through Headphones and other through Speakers

I am using AVPlayer to play two songs simultaneously.
I want to play song on Speaker and before playing i want to check it in headphones only(another song will be playing at the same time in speakers) then i want to play on speakers.Its like prelistening of a song before routing it to Speakers.
Is it Possible on iOS..?
I'd say this would only be possible by used private APIS (if at all) once the iPhone has headphones plugged in everything is routed to it so you'd be trying to change a low-level setting.

Using AVAudioPlayer and MPMoviePlayerController simultaneously

I need to use AVAudioPlayer and MPMoviePlayerController simultaneously i.e play a movie while the background loop is playing is it possible.
My bg music loop stops working when a movie starts playing , so I tried to stop the bg music loop and start the movie and when movie stops, start playing the bg loop again but this is also is not working.
In fact it is achievable from 3.x onwards. I had once done this in one of my applications and its got nothing to do with any backgrounding or any other new iOS features. You just need to configure the audio sessions properly. If you make sure that both your audio player as well as the video player are using the ambient audio session it is possible.
Prior to starting your AVAudioPlayer to play, set the category of audio session to AVAudioSessionCategoryAmbient. This is the system wide common audio session. This allows other sounds to play along such as the sound from the iPod application.
In case you are using the MPMoviePlayerController from iOS 3.2 or above make sure you set the useApplicationAudioSession to NO. This ensures other sounds to play along. It is the default in earlier versions of iOS.
There is a limitation in the current iPhone SDK (2.x and 3.x) that does not allow any background audio playing while a movie is playing in the MPMoviePlayerController API. Unfortunately, it is not possible to do what you are asking at this time within the iPhone SDK.
I would suggest logging an enhancement request to Apple to offer this in a future version of the SDK.