File tree Expand file tree Collapse file tree 1 file changed +23
-3
lines changed
articles/cognitive-services/Speech-Service/includes/quickstarts/text-to-speech-basics Expand file tree Collapse file tree 1 file changed +23
-3
lines changed Original file line number Diff line number Diff line change @@ -171,9 +171,29 @@ import (
171
171
" github.com/Microsoft/cognitive-services-speech-sdk-go/speech"
172
172
)
173
173
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>"
177
197
178
198
config , err := speech.NewSpeechConfigFromSubscription (subscription, region)
179
199
if err != nil {
You can’t perform that action at this time.
0 commit comments