Azure Speech SDK Connection Configuration

Implement AI solutions for text and speech by using Foundry
Answer Correct answer: D — SpeechConfig is the class used to configure the connection to the Azure Speech service by holding subscription keys and region information.

You are using the Azure Speech SDK to develop a Python application that supports real-time spoken conversations. Which Azure Speech class should you use to configure the connection to the Azure Speech service?

  1. AudioOutputConfig
  2. SpeechSynthesizer
  3. AudioConfig
  4. SpeechConfig Correct Answer

Community Insight

The exam tests your ability to distinguish between connection configuration (SpeechConfig) and audio device/stream configuration (AudioConfig).

This question tests the correct Azure Speech SDK class for establishing a service connection. The correct answer is SpeechConfig, which manages authentication and endpoint details.

Candidates often choose AudioConfig because it deals with audio input, but it only configures the local audio source or stream, not the service connection itself.

Community Discussion (4 comments)

Mary_Matic 👍 1 Selected: D
SpeechConfig: This is the foundational class in the Azure Speech SDK (available for Python, C#, etc.) used to configure the connection to the Azure Speech service (specifying your subscription key, service region, or endpoint).
vbhoyar54 👍 1 Selected: D
D. SpeechConfig
HetMShah 👍 2 Selected: D
D. SpeechConfig SpeechConfig is the class used to configure the connection to the Azure Speech service. It holds the credentials and endpoint information needed to authenticate and connect — specifically, you initialize it with your subscription key and region: Why not the others: A. AudioOutputConfig — controls where synthesized audio is sent (speaker, file, stream), not the service connection. B. SpeechSynthesizer — the class that performs text-to-speech; it takes a SpeechConfig as input but doesn't configure the connection itself. C. AudioConfig — controls the audio input source (microphone, file) for speech recognition; again, not the service connection.
derafazu 👍 3 Selected: D
Just a note for clarity: SpeechConfig handles the service connection (key/region), while AudioConfig (the tempting wrong answer) only configures the audio device/stream. Don't confuse the two.

Comments & Corrections

No comments yet — spotted an error or have a note? Share it below.

Log in to comment, report an error, or add a note about this question.

Submitted for moderation before publishing. Keep it helpful and respectful.

Expert Analysis

Why the Answer Is Correct

SpeechConfig is the foundational class in the Azure Speech SDK used to configure the connection to the Azure Speech service. It holds the necessary credentials (subscription key or token) and endpoint information (region or custom endpoint) required to authenticate and connect to the service. Without SpeechConfig, no other speech operations can be initiated.

Why the Other Options Are Wrong

AudioConfig is used to specify the audio input source (microphone) or output destination (speaker/file), but it does not handle the service connection logic. AudioOutputConfig specifically controls where synthesized audio is sent, such as to a speaker or file stream, and is unrelated to connecting to the Speech API. SpeechSynthesizer is the high-level class used to perform text-to-speech conversion; it requires a SpeechConfig instance to function but does not itself establish the initial connection parameters.

Community Comment Notes

Community consensus strongly supports SpeechConfig. As derafazu noted, "SpeechConfig handles the service connection... while AudioConfig... only configures the audio device/stream." HetMShah clarified that SpeechConfig holds "credentials and endpoint information needed to authenticate and connect," distinguishing it from AudioOutputConfig which controls output destinations.

Official Reference

Exam Strategy

When configuring Azure Cognitive Services SDKs, always identify the class responsible for authentication and endpoint settings first. In Speech SDK, this is SpeechConfig; in Vision SDK, it might be ImageAnalysisClient or similar depending on the API version. Memorize the separation of concerns: connection vs. I/O vs. processing.

Frequently Asked Questions

What is the difference between AudioConfig and SpeechConfig?

SpeechConfig handles the service connection (key/region), while AudioConfig specifies the audio input/output device or stream.

Can I use SpeechSynthesizer without SpeechConfig?

No, SpeechSynthesizer requires a SpeechConfig instance to initialize and connect to the Azure Speech service.

More AI-901 FAQ →

Related Analysis

Practice All AI-901 Questions

Access 105 questions with complete answers and detailed explanations.

View Full AI-901 Practice Test →

← Back to AI-901 Study Guide