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 Speech
Azure Speech
An Azure service that integrates speech processing into apps and services.
832 questions
{count} votes