GaryE
GaryE

Reputation: 1

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.

Upvotes: 0

Views: 1537

Answers (1)

Vityata
Vityata

Reputation: 43575

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

Upvotes: 2

Related Questions