0

I'm quite new to programming in c# but I'm trying to convert plain text into a phonetic representation. I convert the plain text by using the PhonemeReached Event and call them by e.Phoneme. (See code below).

//Initialize Synthesizer for TTS and extracting Phonemes 
SpeechSynthesizer synth = new SpeechSynthesizer(); 

//Calling the PhonemeReachedEvent
synth.PhonemeReached += new EventHandler <PhonemeReachedEventArgs>(synth_PhonemeReached);

//Speaking the text from richTextBox1 
synth.SpeakAsync(richTextBox1.Text); 

//The Event 
private void synth_PhonemeReached(object sender, PhonemeReachedEventArgs e) 
  { 
    string output = e.Phoneme; 

    //Writing the Phoneme to the richTextBox2
    richTextBox2.AppendText(string.Format(output)); 
  }

I return the result of e.Phoneme in a richtextbox, but it only writes jibberish (see picture below). It feels like an encoding issue and I would like to know your opinion on how to solve this issue.

https://i.stack.imgur.com/OaDhm.jpg

UPDATE: As stated in the comments Jalkar managed to it working on win7. When I tested my application on Windows 7, I actually got a phoneme-like string. However, when decoded to ASCII it represents jibberish. (So far I haven't been able to get a grasp of how to convert it to Universal Phone Set). Secondly, as Hans Passant stated, the ASCII of the jibberish in the screenshot are indices to the American Phone set (see his link). The weird part however, is that both Win7 and Win8 provide completely different results.

In the screenshot below the results on Win7: http://imgur.com/aTxf5OE

In this screenshot the results on Win8: imgur.com/crAR5HV

If someone knows how to use the IPA to UPS from Microsoft in c#, I would love to hear that.

Nimuin
  • 1
  • 1
  • Is there anything after the e.Phoneme - like e.Phoneme. ?? – Dave Gordon May 13 '15 at 08:52
  • https://msdn.microsoft.com/en-us/library/system.speech.synthesis.phonemereachedeventargs(v=vs.110).aspx) May be try with a 'classic' TextBox like in the example – Jalkar May 13 '15 at 09:00
  • @DaveGordon there is nothing after e.Phoneme. Should there be? – Nimuin May 13 '15 at 09:25
  • @Jalkar I've literally copied that code, however I still get the weird icons rather than the phonetic symbols – Nimuin May 13 '15 at 09:26
  • @Nimuin did you try to change the RichTextBox Font and/or the Current Culture of your app ? I've try the msdn example and it work for me (Win7,Winforms, French Culture, no font change) – Jalkar May 13 '15 at 09:46
  • The string you get does not contain characters, it contains *indices* into a phoneme table. Translating it to an IPA symbol is up to you. The phoneme table for American English is [shown here](https://msdn.microsoft.com/en-us/library/jj127450.aspx). – Hans Passant May 13 '15 at 11:14
  • I found a partial answer. I run windows 8.1 on my machine, however when I ran it on a friends computer (win7) it worked out of the box. Just need some finetuning now. Thank you for the comments. (If anyone knows a solution for compatibility on Windows 8.1, I would like to know) – Nimuin May 19 '15 at 08:02

0 Answers0