Share via

Why AEC is not working with Java Embedded Speech Recognizer?

Ricardo Santos 20 Reputation points
2025-09-26T20:24:15.6233333+00:00

Should not AEC be working by default?

As it was not, I tried to force with AudioProcessingOptions. But still not working. It needs some extension dependency to MAS, like in C++/C#?

audioProcessingOptions = AudioProcessingOptions.create(
    AudioProcessingConstants.AUDIO_INPUT_PROCESSING_ENABLE_DEFAULT,
    PresetMicrophoneArrayGeometry.Linear2,
    SpeakerReferenceChannel.LastChannel
)
audioConfig = AudioConfig.fromDefaultMicrophoneInput(audioProcessingOptions)
speechConfig = EmbeddedSpeechConfig.fromPath(MODELS_PATH)
speechConfig.setSpeechRecognitionModel(MODEL_NAME, LICENSE)
speechRecognizer = SpeechRecognizer(speechConfig, audioConfig)

This is being developed in Desktop, dependency used is below

implementation("com.microsoft.cognitiveservices.speech:client-sdk-embedded:1.46.0@jar")

In past I also tried with Android, and also didn't worked. As android has it own AEC, I implemented with native. But to Windows it has no AEC with Java/Kotlin only, so why I can't make AEC work with MAS setup?

Azure Speech in Foundry Tools
0 comments No comments

Answer accepted by question author

Sina Salam 30,166 Reputation points Volunteer Moderator
2025-09-27T16:07:47.63+00:00

Hello Ricardo Santos,

Welcome to the Microsoft Q&A and thank you for posting your questions here.

I understand that your AEC is not working with Java Embedded Speech Recognizer.

Yes, AEC should be working via MAS in the Speech SDK, but it is not guaranteed in every language binding or platform. Because, in Java embedded scenarios, it’s common for MAS or the reference loopback channel to be unavailable, leading to AEC silently not working.

Do the following to resolve the issue:

  1. Enable SDK FileLogger and run your app; save speech_sdk.log. - https://learn.microsoft.com/en-us/azure/ai-services/speech-service/how-to-use-logging
  2. Inspect the client-sdk-embedded-1.46.0.jar for MASmodels. If not found, change Gradle dependency (remove @jar) or download the SDK distribution and copy the runtimes folder. - https://central.sonatype.com/artifact/com.microsoft.cognitiveservices.speech/client-sdk-embedded
  3. If logs show aec_v1.fpie (or other model file missing) copy MASmodels into runtimes/<os>/native/ or ensure the distribution is included beside your app.
  4. If MAS loads (logs show MAS models found) but echo persists test with a WAV file containing reference channel (isolates device/driver), and check the device playback/capture routing. -https://learn.microsoft.com/en-us/azure/ai-services/speech-service/audio-processing-speech-sdk

Use the associated links for more steps and details.

I hope this is helpful! Do not hesitate to let me know if you have any other questions or clarifications.


Please don't forget to close up the thread here by upvoting and accept it as an answer if it is helpful.

Was this answer helpful?


0 additional answers

Sort by: Most helpful

Your answer

Answers can be marked as 'Accepted' by the question author and 'Recommended' by moderators, which helps users know the answer solved the author's problem.