File tree 1 file changed +5
-3
lines changed
1 file changed +5
-3
lines changed Original file line number Diff line number Diff line change @@ -15,9 +15,10 @@ let getVoiceId (voice: VoiceType) =
15
15
16
16
let handleSynthesisResult ( task : Task < SpeechSynthesisResult >) =
17
17
task.Wait()
18
- match task.Result.Reason with
18
+ use result = task.Result
19
+ match result.Reason with
19
20
| ResultReason.Canceled ->
20
- let cancellation = SpeechSynthesisCancellationDetails.FromResult task.Result
21
+ let cancellation = SpeechSynthesisCancellationDetails.FromResult result
21
22
if CancellationReason.Error = cancellation.Reason then
22
23
match cancellation.ErrorCode with
23
24
| CancellationErrorCode.ConnectionFailure ->
@@ -27,7 +28,8 @@ let handleSynthesisResult (task: Task<SpeechSynthesisResult>) =
27
28
| _ ->
28
29
printfn " Error: ErrorCode=%A \n ErrorDetails=%A " cancellation.ErrorCode cancellation.ErrorDetails
29
30
1
30
- | _ -> 0
31
+ | _ ->
32
+ 0
31
33
32
34
let performSpeechSynthesis ( config : Argu.ParseResults < Args >, speechConfig : SpeechConfig ) =
33
35
if config.Contains Output then
You can’t perform that action at this time.
0 commit comments