sharkyenergy
sharkyenergy

Reputation: 4183

TTS microsoft.speech, best way to say a sentence fluently with language change

I need to say a sentence, with a german name in the sentence. To do so I used Microsoft speech with english, called the speakasync function to say the first part of the sentence, then changed Language to german, said the name, then went back to english and finished the sentence. this all works well, except that each time i call the speakasync function the is a 1 second pause. so I have 1 second pause before and after the name. can this be removed somehow? I would like to have no pause in between.

    s.SetOutputToDefaultAudioDevice()
    s.SelectVoice(myENGLISHvoice)
    s.SpeakAsync("Next on the line is mr. ")
    s.SelectVoice(myGERMANvoice)
    s.SpeakAsync("Stefan Hanswurst")
    s.SelectVoice(myENGLISHvoice)
    s.SpeakAsync("Please stand up.")

Update, I have also tried this, with no success.. same problem:

    pb.AppendSsmlMarkup("<voice xml:lang=""en-EN"">")
    pb.AppendText("Next on the line is mr.")
    pb.AppendSsmlMarkup("</voice>")

    pb.AppendSsmlMarkup("<voice xml:lang=""de-DE"">")
    pb.AppendText("Hansjörg Bratwurst ")
    pb.AppendSsmlMarkup("</voice>")

    pb.AppendSsmlMarkup("<voice xml:lang=""en-EN"">")
    pb.AppendText("Please stand up.")
    pb.AppendSsmlMarkup("</voice>")

Upvotes: 2

Views: 194

Answers (1)

Peter Branforn
Peter Branforn

Reputation: 1697

In context of speech engines you usually avoid switching language during speech output, this is unusual since humans also simply stick to one pronounciation (see how Americans and Italiens pronounce coffee or Cappuccino for example).

Usually this is done by inserting pronounciation hints for "foreign" words into the language you currently generate output for. Just like Germans have to learn how to pronounce "Cappuccino" and it will still always have a German accent/specific to it.

See details for microsofts speech API here (search for "pronunciation"-> they have a spelling error on the page): https://msdn.microsoft.com/en-us/library/hh378454(v=office.14).aspx

Upvotes: 1

Related Questions