Skip to content

Commit b6b3a2a

Browse files
committed
Merge branch 'main' of https://github.com/MicrosoftDocs/azure-docs-pr into afdcaching
2 parents dc8de2a + 356b047 commit b6b3a2a

File tree

1 file changed

+23
-3
lines changed
  • articles/cognitive-services/Speech-Service/includes/quickstarts/text-to-speech-basics

1 file changed

+23
-3
lines changed

articles/cognitive-services/Speech-Service/includes/quickstarts/text-to-speech-basics/go.md

Lines changed: 23 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -171,9 +171,29 @@ import (
171171
"github.com/Microsoft/cognitive-services-speech-sdk-go/speech"
172172
)
173173

174-
func main(subscription string, region string) {
175-
subscription := "<paste-your-speech-key-here>"
176-
region := "<paste-your-speech-location/region-here>"
174+
func synthesizeStartedHandler(event speech.SpeechSynthesisEventArgs) {
175+
defer event.Close()
176+
fmt.Println("Synthesis started.")
177+
}
178+
179+
func synthesizingHandler(event speech.SpeechSynthesisEventArgs) {
180+
defer event.Close()
181+
fmt.Printf("Synthesizing, audio chunk size %d.\n", len(event.Result.AudioData))
182+
}
183+
184+
func synthesizedHandler(event speech.SpeechSynthesisEventArgs) {
185+
defer event.Close()
186+
fmt.Printf("Synthesized, audio length %d.\n", len(event.Result.AudioData))
187+
}
188+
189+
func cancelledHandler(event speech.SpeechSynthesisEventArgs) {
190+
defer event.Close()
191+
fmt.Println("Received a cancellation.")
192+
}
193+
194+
func main() {
195+
subscription := "<paste-your-speech-key-here>"
196+
region := "<paste-your-speech-location/region-here>"
177197

178198
config, err := speech.NewSpeechConfigFromSubscription(subscription, region)
179199
if err != nil {

0 commit comments

Comments
 (0)