I'm trying to use the sample code provided by Google to get the SpeechToText Api working for DotNet although i keep getting errors trying to run the sample code straight out-of-the-box. (Reference: https://github.com/GoogleCloudPlatform/dotnet-docs-samples/tree/master/speech/api/Recognize)
As a pre-cursor, I have already subscribed to gCloud and enabled VoiceToText. There is no issues authenticating with google because i've been able to get a response back from the API running the QuickStart sample. (https://github.com/GoogleCloudPlatform/dotnet-docs-samples/tree/master/speech/api/QuickStart)
The sample of code from https://github.com/GoogleCloudPlatform/dotnet-docs-samples/tree/master/speech/api/Recognize should activate the microphone on my Mac and send the audio to Google Speech-To-Text Api, with an expected JSON response of the transcribed audio. Once I have downloaded the code and "CD" into the api/Recognize folder, I run the following
DOTNET RESTORE
DOTNET RUN LISTEN 3
I get the following errors.
$ dotnet run listen 3
/GoogleVoiceToText/dotnet-docs-samples/speech/api/Recognize/Recognize.csproj : warning NU1701: Package 'NAudio 1.8.3' was restored using '.NETFramework,Version=v4.6.1' instead of the project target framework '.NETCoreApp,Version=v2.0'. This package may not be fully compatible with your project.
/GoogleVoiceToText/dotnet-docs-samples/speech/api/Recognize/Recognize.csproj : warning NU1701: Package 'NAudio 1.8.3' was restored using '.NETFramework,Version=v4.6.1' instead of the project target framework '.NETCoreApp,Version=v2.0'. This package may not be fully compatible with your project.
Unhandled Exception: System.AggregateException: One or more errors occurred. (Unable to load DLL 'winmm.dll': The specified module or one of its dependencies could not be found. (Exception from HRESULT: 0x8007007E)) ---> System.DllNotFoundException: Unable to load DLL 'winmm.dll': The specified module or one of its dependencies could not be found. (Exception from HRESULT: 0x8007007E) at NAudio.Wave.WaveInterop.waveInGetNumDevs() at NAudio.Wave.WaveIn.get_DeviceCount() at GoogleCloudSamples.Recognize.d__11.MoveNext() in /GoogleVoiceToText/dotnet-docs-samples/speech/api/Recognize/Recognize.cs:line 405 --- End of inner exception stack trace --- at System.Threading.Tasks.Task`1.GetResultCore(Boolean waitCompletionNotification) at GoogleCloudSamples.Recognize.<>c.b__13_3(ListenOptions opts) in /GoogleVoiceToText/dotnet-docs-samples/speech/api/Recognize/Recognize.cs:line 494 at GoogleCloudSamples.Recognize.Main(String[] args) in /GoogleVoiceToText/dotnet-docs-samples/speech/api/Recognize/Recognize.cs:line 480
I suspect the issue may be an outdated package - NAudio 1.8.3. I've tried upgrading to NAudio 1.8.4, still get the same issues. Not sure if anybody has had similar issues? Alternatively, if anybody has a recent example of the SpeechToText Api using microphone streaming that actually work, that would be so much appreciated?
User contributions licensed under CC BY-SA 3.0