问题
Is there an out-of-the-box solution to stream a wav file/memory to a UWP app? Windows.Media.SpeechRecognition looks like it only accepts microphone input. Is there a way to use System.Speech.Recognition in a UWP app? Is there an official way to use Windows.Media.SpeechRecognition in a Windows desktop app?
回答1:
Please check Speech APIs, this is a set of REST API provided by Microsoft which can accept wav files.
回答2:
You can use VB-Audio Virtual cable http://vb-audio.pagesperso-orange.fr/Cable/index.htm in order to transcribe a .wav file.
You can use Windows.Media.SpeechRecognition API in a console or desktop app in the same way you can reference the other UWP API:
- Edit "yourproject".csproj
- Add TargetPlatformVersion10.0 /TargetPlatformVersion below TargetFrameworkVersion
- Reload Project
- Add Reference->Browse Windows.winmd from C:\Program Files (x86)\Windows Kits\10\UnionMetadata
- Add Reference->Browse System.Runtime.WindowsRuntime from C:\Program Files (x86)\Reference Assemblies\Microsoft\Framework.NETCore\v4.5\System.Runtime.WindowsRuntime.dll.
- set "Copy Local=False" into System.Runtime.WindowsRuntime properties
来源:https://stackoverflow.com/questions/34301189/possible-to-stream-wav-file-to-windows-media-speechrecognition