当前位置: 动力学知识库 > 问答 > 编程问答 >

Need VBA to German text to speech

问题描述:

I am able to translate English text to German, but am unable to have the German text actually spoken in German. The TTS voices are not pronouncing the German words correctly. Google translate has correct pronunciation but I don't know how to call in from Visual Basic.

网友答案:

Download the german TTS version here

It should work.

Edit: Here is how you check the available voices that you have: (the code is from here, I have made a late binding, so it works without adding libraries)

Option Explicit


    Sub AvailableVoices()

        Dim i           As Long
        Dim voc         As Object

        Set voc = CreateObject("SAPI.SpVoice")

        Debug.Print voc.GetVoices.Count & " available voices:"

        For i = 0 To voc.GetVoices.Count - 1
            Set voc.Voice = voc.GetVoices.Item(i)
            Debug.Print " " & i & " - " & voc.Voice.GetDescription
            voc.Speak "test audio"
        Next i

    End Sub
分享给朋友:
您可能感兴趣的文章:
随机阅读: