Azure Speech SDK Connection Configuration
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?
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)
Comments & Corrections
No comments yet — spotted an error or have a note? Share it below.
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.
Related Analysis
Practice All AI-901 Questions
Access 105 questions with complete answers and detailed explanations.
View Full AI-901 Practice Test →