Open jet-yangqs opened 2 years ago
The feedback loop is a natural consequence os recording and playing simultaneously. You can reduce the feedback by lowering your phone volume.
The LiveEffect app was designed to use a single output callback that reads data from the input. It was designed that way for a reason. Using two callbacks makes it difficult to synchronize the two streams.
I would recommend keeping the FullStreamDuplex class from the LiveEffect app.
Also, it may be better to use the VoicePerformance input preset. It may use echo cancellation to reduce feedback. In this code add:
->setInputPreset(oboe::InputPreset::VoicePerformance)
Thank you for your reply and advice. The feedback loop reduce( not completely eliminated) after I setted InputPreset and lowered the phone volume, but there are also some gitchs left. The output is not that pleasant to listen to. And my question become these:
When I add: ->setInputPreset(oboe::InputPreset::VoicePerformance) what effects are applied to the input audio? does it include AcousticEchoCanceler?
I saw from #951 that if I want to enable AcousticEchoCanceler effect, I need to pass audioSessionId from java to native c++. So what the relation among oboe::Usage::VoiceCommunication, oboe::InputPreset::VoicePerformance, AcousticEchoCanceler effect and audioSessionId? For exmaple, if I set oboe::InputPreset::VoicePerformance, but do not create a session ID in java, would the input stream has AcousticEchoCanceler effect? What if I set oboe::Usage::VoiceCommunication together with oboe::InputPreset::VoiceCommunication(note: it is not oboe::InputPreset::VoicePerformance)?
what is the best practice to capture iuput audio with AcousticEchoCanceler effect and lower latency? Thank you!
@jet-yangqs did you found the answers to your questions? I would be glad to hear the answers from the oboe team (@philburk ?) since I run into the same confusions, since there is no obvious guideline on how to enable AEC on Android. Any help would be appreciated !
I want to make a APP which can record the speaking of someone through mic phone and playing it through speaker of android device by modifying the liveEffect APP.
What I expected: recording the speaking of some body through mic phone and playing it through speaker Simultaneously. What I got: it can not record human voice correctly. if I make a beep near the phone, the output audio of speaker is beep with feedback loop.(same Phenomenon with liveEffect APP)
my modifications include:
why I can not get what I want from the design above? can you give me some advices?