Open banburubi opened 4 years ago
Do not create an AudioRecord. Just allocate a sessionId.
AudioManager audioManager = (AudioManager) context.getSystemService(Context.AUDIO_SERVICE);
int audioSessionId = audioManager.generateAudioSessionId();
Thank you veyr much for the reply.
When I'm trying to use session id from audioManager.generateAudioSessionId()
to create AcousticEchoCanceler by AcousticEchoCanceler.create( sessionId )
it returns null
when I use session from AudioRecord - it is not null
Though I found how to make it work, it is sarting to work when I change preset on input stream creation
builder->setInputPreset(oboe::InputPreset::VoiceCommunication)
, but then I'm getting not a Low-latency stream. Can I do something to keep the stream Low-latency?
I'm still getting low-latency steam the only difference it is not Exclusive anymore (when session id is set).
EXCLUSIVE streams are only supported on the new MMAP data path. Sessions and Effects are only supported on the Legacy data path. The Legacy data path will not use the FAST low-latency mixer when effects are enabled.
I will review this limitation with the team.
One way to achieve low latency with effects is to add your own effects above the OS.
Thank you very much. It is clear. I will try to integrate AEC from WebRTC it is just a bit more time consuming from the development perspective.
@philburk Hi, Is this issue not solved on low-latency audio thread yet? If not, are there any way to achieve to implement in Oboe-layer?
I'm working to create karaoke-live-streaming app on Android. There is problem when user does not use earphone( audio feedback happens )
I improved the Effects test in OboeTester. I then tested on a Pixel 3a running RQ1A. (11). I was able to get a low-latency input stream when I enabled the effect. I was using InputPreset=VoiceRec. If I selected VoiceCommunication then I did not get any input signal.
Android version(s): 10 Android device(s): Google Pixle 3a Oboe version: 1.4.2 App name used for testing: Similar to LiveEffect
Short description In voice related application, I'm working on, I have a feedback loop and to avoid it I'm trying to apply Android AEC effect to Oboe Input stream. The acutal sample does not work: https://github.com/google/oboe/blob/master/docs/notes/effects.md
Steps to reproduce
In my case for AEC to be intialized properly I need to use such code in Java:
a few strings below there is such an activation of AEC:
Oboe stream is created later with session id from AudioRecord.
There are no errors, AEC is enabled and session id is set to Oboe Input stream. I'm still getting low-latency steam the only difference it is not Exclusive anymore (when session id is set).
I have also tried with NoiseSuppressor effect with the same result.
Expected behavior Echo and some noise should be removed if an effect is attached.
Actual behavior Does not work.
Looking forward to your feedback.
Thank you very much.
P.S. Probably these issues are related: https://github.com/google/oboe/issues/296 https://github.com/google/oboe/issues/898 https://github.com/google/oboe/issues/85
Best, Vladymyr.