SpeechTranslationConfig.setSpeechSynthesisOutputFormat() in Java SDK doesn't work

Slimek Wu 1 Reputation point
2020-12-05T04:00:00.363+00:00

Hi

I'm trying Java Speech SDK 1.14.0 for speech translation on Android. I use SpeechTranslationConfig to create a TranslationRecognizer:

AudioConfig audio = AudioConfig.fromDefaultMicrophoneInput();

SpeechTranslationConfig config = SpeechTranslationConfig.fromSubscription(
        subscriptionKey,
        subscriptionRegion
);

config.setSpeechRecognitionLanguage(sourceLanguage);
config.addTargetLanguage(targetLanguage);
config.setSpeechSynthesisLanguage(targetLanguage);
config.setVoiceName(voiceName);
config.setSpeechSynthesisOutputFormat(SpeechSynthesisOutputFormat.Raw16Khz16BitMonoPcm);

this.recognizer = new TranslationRecognizer(config, audio);

...

Everything is fine, except that no mater what I set in setSpeechSynthesisOutputFormat(), it always gives me the audio in Riff16Khz16BitMonoPcm format, which seems to be the default value.

Is there any other way to specify the speech synthesis output format?

Azure AI Speech
Azure AI Speech
An Azure service that integrates speech processing into apps and services.
1,713 questions
{count} votes

Your answer

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