await SpeechSynthesizer Async methods crash without throwing an error
See original GitHub issueI’m working in Visual Studio 2019 on a .Net Core 3.1 library and using Microsoft.CognitiveServices.Speech
ver 1.18.0 and even with the simplest program imaginable:
using Microsoft.CognitiveServices.Speech;
using System;
using System.Net.Http;
using System.Threading.Tasks;
namespace TextToSpeech
{
public class SimpleAzureTest
{
public static async Task SynthesizeAudioAsync()
{
var config = SpeechConfig.FromSubscription("My Key", "southcentralus");
using var synthesizer = new SpeechSynthesizer(config);
await synthesizer.SpeakTextAsync("Synthesizing directly to speaker output.");
}
}
}
When I try run this in Debug mode, I get until the await
line and, then, the program just dies. I can’t wrap it in a try
catch
and am not getting back a HTTP result to examine, it simply dies and exits debug mode when trying to run the await
line of code and the output window states The program '[15480] Tests.exe' has exited with code 0 (0x0).
I’ve checked my key and region in Azure and my subscription status is Active and doesn’t seem to have any issues in terms of hitting a call quota or anything else and I am able to use the same key and region to get results directly via the Microsoft REST API, so I’m really not sure what’s happening here.
How can I figure out the source of this issue / what can be done to fix it?
Issue Analytics
- State:
- Created 2 years ago
- Comments:5 (3 by maintainers)
Top GitHub Comments
I was using the following code to repro…
Yulin, thank you so much for your help with this - I ended up re-writing the class library and it ended up working. The more I think about it, the more I think it may have just been a corrupt file in my csproj or something because nothing else really made much sense.
The point is it is working now and I’m chalking this up to a VS issue rather than a library one. Thank you SO much for oyur time, help and thought on this!!