Skip to content

Synthesis does not return error on invalid voice name #148

@chrbsg

Description

@chrbsg

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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions