Quantcast
Channel: Active questions tagged nuget-package - Stack Overflow
Viewing all articles
Browse latest Browse all 3067

NuGet microsoft.cognitiveservices.speech produces 0kb files

$
0
0

I have been using this code for a month. My azure account is in good standing. However, when I run it now, it produces a 0kb file. The amount of text I am attempting to generate is around 700 words.

using Microsoft.CognitiveServices.Speech.Audio;using Microsoft.CognitiveServices.Speech;namespace TextToSpeech{    class Program    {        static async Task Main()        {            await SynthsizeAudioAsync();        }        static async Task SynthsizeAudioAsync()        {            var config = SpeechConfig.FromSubscription("***", "***");            config.SpeechSynthesisVoiceName = "en-US-ChristopherNeural";            AudioConfig audioConfig = AudioConfig.FromWavFileOutput("D:\\file.wav");            using var synthesizer = new SpeechSynthesizer(config, audioConfig);            await synthesizer.SpeakTextAsync("Hello!");        }    }}

There are no errors, but when it attempts to synthesize the speech it "crashes" and creates a 0kb file. I have tried generating an mp3 instead and it creats a 0kb mp3. I am not sure what to do from here. Thanks for looking into this.

I tried to change the api key, I have tried to change the voice. I have upgraded my azure account to basic plan. I have tried to add logging but it is actually running all the code. It thinks that it has finished but really the files are empty.


Viewing all articles
Browse latest Browse all 3067

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>