Azure Speech Service: Creating Speech Configuration | Exam AI-102

Creating Speech Configuration

Question

You plan to use the Azure Speech service to convert text to speech and output it to an audio file.

Given that the prerequisites are met, Speech SDK is installed and required packages are included.

Sequence the steps involved in creating the Speech configuration by putting them in the correct order.

Step 1: Instantiate SpeechSynthesizer. Step 2: Create an AudioConfig to write output to an audio file. Step 3: Create a SpeechConfig using the subscription key and associated Azure region. Step 4: Execute Speech synthesis using the text.

Answers

Explanations

Click on the arrows to vote for the correct answer

A. B. C. D.

Correct Answer: A.

Option A is correct.

The correct order for execution steps is:

Create a SpeechConfig using the subscription key and associated Azure region.

Create an AudioConfig to write output to an audio file.

Instantiate SpeechSynthesizer.

Execute Speech synthesis using the text.

Option B is incorrect because SpeechSynthesizer requires AudioConfig and SpeechConfig.

Hence SpeechConfig needs to be created before instantiating SpeechSynthesizer.

Option C is incorrect because executing Speech synthesis would require SpeechSynthesizer to be instantiated first, which requires AudioConfig and SpeechConfig.

Hence this is not the correct order.

Option D is incorrect because SpeechSynthesizer requires AudioConfig and SpeechConfig.

Hence SpeechConfig needs to be created before instantiating SpeechSynthesizer.

Reference:

To learn more about synthesizing speech to a file, use the link given below:

The correct sequence of steps involved in creating the Speech configuration using the Azure Speech service to convert text to speech and output it to an audio file is:

Step 1: Instantiate SpeechSynthesizer. This step involves creating an instance of the SpeechSynthesizer class which is used to convert text to speech. It provides a SpeakTextAsync method that takes a string parameter representing the text to be converted to speech.

Step 2: Create an AudioConfig to write output to an audio file. This step involves creating an instance of the AudioConfig class that specifies the output format of the audio file to be generated. The AudioConfig class provides several output formats including WAV, MP3, and RAW.

Step 3: Create a SpeechConfig using the subscription key and associated Azure region. This step involves creating an instance of the SpeechConfig class that is used to configure the Speech service. The SpeechConfig requires a subscription key and the associated Azure region to authenticate and identify the Speech resource.

Step 4: Execute Speech synthesis using the text. This final step involves passing the text to the SpeakTextAsync method of the SpeechSynthesizer class to convert it to speech. The output is then written to an audio file using the AudioConfig object created in Step 2.

Therefore, the correct sequence is D. Step 1 -> Step 2 -> Step 3 -> Step 4.