小编Moh*_*MVP的帖子

如何在Vue.js中设置整个页面的键盘

是否可以v-on:keyup.enter在整个页面上设置一个,而不仅仅是javascript框架中的输入元素Vue.js?

vue.js

14
推荐指数
3
解决办法
5543
查看次数

C# 非静态字段、方法或属性需要对象引用 - 语音合成

我尝试使用此代码示例构建一个测试应用程序

我定义了一个公共类,如下所示:

 public class iSpeech
 {
    // Performs synthesis
    public async Task<IRandomAccessStream> SynthesizeTextToSpeechAsync(string text)
    {
        IRandomAccessStream stream = null;
        using (SpeechSynthesizer synthesizer = new SpeechSynthesizer())
        {
            VoiceInformation voiceInfo =
              (
                from voice in SpeechSynthesizer.AllVoices
                where voice.Gender == VoiceGender.Male
                select voice
              ).FirstOrDefault() ?? SpeechSynthesizer.DefaultVoice;

            synthesizer.Voice = voiceInfo;
            stream = await synthesizer.SynthesizeTextToStreamAsync(text);
        }
        return (stream);
    }

    // Build audio stream
    public async Task SpeakTextAsync(string text, MediaElement mediaElement)
    {
        IRandomAccessStream stream = await this.SynthesizeTextToSpeechAsync(text);
        await mediaElement.PlayStreamAsync(stream, true);
    }
}
Run Code Online (Sandbox Code Playgroud)

从应用程序主页,然后我尝试调用:

    public …
Run Code Online (Sandbox Code Playgroud)

c# methods reference uwp

1
推荐指数
1
解决办法
3713
查看次数

标签 统计

c# ×1

methods ×1

reference ×1

uwp ×1

vue.js ×1