Change the voice name to an invalid voice and run synthesis:
diff --git a/samples/synthesizer/to_audio_data_stream.go b/samples/synthesizer/to_audio_data_stream.go
index b440f6c..700964f 100644
--- a/samples/synthesizer/to_audio_data_stream.go
+++ b/samples/synthesizer/to_audio_data_stream.go
@@ -20,6 +20,11 @@ func SynthesisToAudioDataStream(subscription string, region string, file string)
fmt.Println("Got an error: ", err)
return
}
+ err = config.SetSpeechSynthesisVoiceName("HAHAHA")
+ if err != nil {
+ fmt.Println("Got an error: ", err)
+ return
+ }
defer config.Close()
speechSynthesizer, err := speech.NewSpeechSynthesizerFromConfig(config, nil)
if err != nil {
go build
./samples ***** myregion file speech_synthesizer:SynthesisToAudioDataStream
Enter some text that you want to speak, or enter empty text to exit.
> hi
Synthesis started.
Read [0] bytes from audio data stream.
Received a cancellation.
Enter some text that you want to speak, or enter empty text to exit.
For the outcome (speech.SpeechSynthesisOutcome) outcome.Error is nil, and outcome.Failed() returns false, both indicating that the synthesis operation succeeded without error. Apart from the cancellation event, there is no other indication of a problem. The cancellation event does not contain any reason as to why the synthesis was cancelled.
Change the voice name to an invalid voice and run synthesis:
For the outcome (
speech.SpeechSynthesisOutcome)outcome.Erroris nil, andoutcome.Failed()returns false, both indicating that the synthesis operation succeeded without error. Apart from the cancellation event, there is no other indication of a problem. The cancellation event does not contain any reason as to why the synthesis was cancelled.