Cognitive-services-speech-sdk: AudioConfig.FromDefaultSpeakerOutput() does not work

Created on 16 Apr 2020  路  2Comments  路  Source: Azure-Samples/cognitive-services-speech-sdk

It still picking up audio from Microphone instead of Sound out from the speaker.

else if (this.UseSystemSound)
{
using (var audioInput2 = AudioConfig.FromDefaultSpeakerOutput())
{
using (basicRecognizer = new SpeechRecognizer(config, audioInput2))
{
await this.RunRecognizer(basicRecognizer, RecoType.Base, stopBaseRecognitionTaskCompletionSource).ConfigureAwait(false);
}
}

        }

Most helpful comment

Hi, FromDefaultSpeakerOutput is not for input configuration. AudioConfig methods From*Output are used with speech synthesis (text to speech) to specify the output for synthesized audio.

To configure the input for recognition, you need to use one of the From*Input methods, ref. https://docs.microsoft.com/en-us/dotnet/api/microsoft.cognitiveservices.speech.audio.audioconfig?view=azure-dotnet.

(Yes, the summary of AudioConfig in C# is not up to date as the class is not for input configuration only - we will update the documentation for the next Speech SDK release.)

All 2 comments

Hi, FromDefaultSpeakerOutput is not for input configuration. AudioConfig methods From*Output are used with speech synthesis (text to speech) to specify the output for synthesized audio.

To configure the input for recognition, you need to use one of the From*Input methods, ref. https://docs.microsoft.com/en-us/dotnet/api/microsoft.cognitiveservices.speech.audio.audioconfig?view=azure-dotnet.

(Yes, the summary of AudioConfig in C# is not up to date as the class is not for input configuration only - we will update the documentation for the next Speech SDK release.)

Thanks

Was this page helpful?
0 / 5 - 0 ratings