【问题标题】:Instruct SAPI to speak "space" character in spellout mode指示 SAPI 在拼写模式下说出“空格”字符
【发布时间】:2018-01-19 06:29:19
【问题描述】:

我有一个 VC++ 应用程序,我试图让 SAPI 拼出一些文本,但它忽略了“空格”字符。有什么办法让它在找到一个时真正说“空格”?

发送到 Speak 函数的示例文本:

<spell>Hello, world</spell>

这将被称为“h e l l o comma w o r l d”。空间被忽略了。我想让它说“h e l l o comma space w o r l d”。

有什么想法吗?谢谢!

【问题讨论】:

    标签: sapi


    【解决方案1】:

    我可以使用标签来做到这一点。 看这里 Controlling SAPI with XML 这就是我最终得到的结果:(VBScript)

    spell_my_text "oh N/o!"
    sub spell_my_text (strText)
        set sapi = createobject ("sapi.spvoice")        
        for i = 1 to (len(strText))
        strmychar = mid(strText,i,1)
        if instr (1,"ABCDEFGHIJKLMNOPQRSTUVWXYZ",strmychar,0) > 0 then          
            strmytext = "<spell>" & strmychar & "</spell>"
            sapi.speak "<xml>capital " & strmychar & "</xml>"
        else    
            sapi.speak "<spell>" & strmychar & "</spell>"
        end if
    Next
    

    结束子

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 2012-06-28
      • 1970-01-01
      • 2018-07-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多