Exam AI-102 Topic 4 Question 310 Discussion

Actual exam question for Microsoft's AI-102 exam
Question #: 310
Topic #: 4
You are developing a streaming Speech to Text solution that will use the Speech SDK and MP3 encoding.
You need to develop a method to convert speech to text for streaming MP3 data.
How should you complete the code? To answer, select the appropriate options in the answer area.
NOTE: Each correct selection is worth one point.

Suggested Answer:


Explanation:

Scenario Recap
You are building a streaming Speech-to-Text solution using the Speech SDK.
Input audio format: MP3 encoding
You must configure the audio stream format and the recognizer properly.
Code Analysis
Audio Format
For MP3 streams, the correct method is:
AudioStreamFormat.GetCompressedFormat(AudioStreamContainerFormat.MP3)
This creates an audio format object for compressed MP3 input.
Recognizer
Since the task is speech-to-text transcription, you need the SpeechRecognizer class.
Other options like KeywordRecognizer, SpeakerRecognizer, or SpeechSynthesizer are not appropriate (they handle keyword spotting, speaker identification, or text-to-speech).
Completed Code Snippet
var audioFormat = AudioStreamFormat.GetCompressedFormat(AudioStreamContainerFormat.MP3); var speechConfig = SpeechConfig.FromSubscription( " 18c51a87-3a69-47a8-aedc-a54745f708a1 " , " westus
" );
var audioConfig = AudioConfig.FromStreamInput(pushStream, audioFormat); using ( var recognizer = new SpeechRecognizer(speechConfig, audioConfig))
{
var result = await recognizer.RecognizeOnceAsync();
var text = result.Text;
}
Final Answer (Answer Area Selections)
AudioFormat: AudioStreamFormat.GetCompressedFormat
Recognizer: SpeechRecognizer
Microsoft References
Speech SDK - AudioStreamFormat
SpeechRecognizer class

by Lynn at Jul 07, 2026, 07:37 AM

Comments

Chosen Answer:
This is a voting comment (?) , you can switch to a simple comment.
Switch to a voting comment New
Nick name: Submit Cancel
A voting comment increases the vote count for the chosen answer by one.

Upvoting a comment with a selected answer will also increase the vote count towards that answer by one. So if you see a comment that you already agree with, you can upvote it instead of posting a new comment.

0
0
0
10