问题
I tried to use the SpeechSynthesizer from System.Speech.Synthesis because it seems more comprehensive than the one I used before (Windows.Media.SpeechSynthesis) : I want to be able to set the volume, the gender of the voice, ... Besides, the french prononciation has some bugs, so I wanted to check if System.Speech was better.
I added the reference, but the Build gives this error and I can't fix it :
Cannot find type System.MarshalByRefObject in module CommonLanguageRuntimeLibrary.
回答1:
There isn't really a way to use the .NET API System.Speech.Synthesis in a WinRT app, without creating an app that will wind up failing the WACK tests for submission.
Many of the .NET namespaces haven't been projected into WinRT. In particular, System.Speech.* since there's already Windows.Media.SpeechSynthesis and Windows.Media.SpeechRecognition, which were brought over from the windows phone API namespaces instead, and should be functionally complete for the majority of purposes.
Only old .NET APIs that are part of the .NETCore profile have been projected to WinRT.
来源:https://stackoverflow.com/questions/32376192/using-system-speech-synthesis-with-windows10-universal-app-xaml-c