Using SAPI is there a way to enter pinyin for Chinese pronunciation?

I’ve made this example and it works fine, I don’t speak Chinese, so, I use auto translator to get the sample word.

Up vote 11 down vote favorite 2 share g+ share fb share tw.

The goal is to be able to pronounce something like wo3. System. Speech can handle Chinese characters, but is there a way to input pinyin directly?

It seems from msdn.microsoft.com/en-us/library/ms72056... that I should be able to write out the pinyin like so How do I use PRON SYM? Update: Here are some web pages that discuss the issue but with no solution: - ms-news.net/f3012/problem-with-phonemes-an... Update2 I am using System.Speech. Synthesizer in .NET.

Perhaps this is the issue. I can see that entering it into the Speech Properties works fine: If I do this from C#, it just reads the tag: var culture = CultureInfo. GetCultureInfo("zh-CN"); var synth = new SpeechSynthesizer(); var voices = synth.

GetInstalledVoices(culture); if (voices. Count > 0) { synth. SelectVoice(voices0.VoiceInfo.

Name); synth. Speak(""); } c# text-to-speech chinese sapi link|improve this question edited Jan 1 at 20:50Charles19k51836 asked Jun 14 '11 at 7:00tofutim2,084515 78% accept rate.

I’ve made this example and it works fine, I don’t speak Chinese, so, I use auto translator to get the sample word. Here is the design of the form: And here is the code behind it; I get the phoneme from the Chinese Phonemes table. Using System; using System.Windows.

Forms; using SpeechLib; namespace SpeechDemo { public partial class Form1 : Form { public Form1() { InitializeComponent(); } private void Form1_Load(object sender, EventArgs e) { //get installed voices SpVoice voice = new SpVoice(); foreach (var item in voice.GetVoices()) { comboBox1.Items. Add(((ISpeechObjectToken)item).GetDescription()); } } private void btnSpeakPhonems_Click(object sender, EventArgs e) { if (comboBox1. SelectedIndex > 0) { SpVoice voice = new SpVoice(); voice.

Voice = voice.GetVoices(). Item(comboBox1. SelectedIndex); voice.

Speak("? ", SpeechVoiceSpeakFlags. SVSFlagsAsync); } } } } Be sure to select (Microsoft Simplified Chinese) from the ComboBox before testing.

If you don’t have it you can download the language package of the Microsoft Speech (SpeechSDK51LangPack. Exe). Edit: in SpeechSynthesizer pron => phoneme and sym => ph .

Here is code works fine with SpeechSynthesizer : private void button1_Click(object sender, EventArgs e) { var cu = CultureInfo. GetCultureInfo("zh-CN"); SpeechSynthesizer sp = new SpeechSynthesizer(); var voices = sp. GetInstalledVoices(cu); sp.

SelectVoice(voices0.VoiceInfo. Name); string s = "? "; sp.

SpeakSsml(s); }.

Aha, I was using System.Speech.Synthesizer. – tofutim Jun 22 '11 at 17:11 Is this doable from System.Speech. Synthesizer?

– tofutim Jun 22 '11 at 17:18 SpeechSynthesizer is kind of wrapper to SAPI COM library, and it seems it has problem with custom pronunciation. You should try using SpeakAsync with PromptBuilder parameter. Create new PromptBuilder and use AppendTextWithPronunciation.

I’ve test it. It works with English culture but not with Chinese.... sorry for delay we have bad internet here :( – Issam Ali Jun 22 '11 at 18:12 PS, if SpeechSynthesizer is just a wrapper why not using the original library it works like charm ;) – Issam Ali Jun 22 '11 at 18:16 it seems there are some syntax changes in the xml used by SpeechSynthesizer . New code added to the answer works fine with SpeechSynthesizer.

Hope this will solve the problem. – Issam Ali Jun 22 '11 at 18:49.

Yes, I get a TargetInvocationException. If you have a working sample of how to use it, that would be great! I was never ever able to make heads or tails from the docs.

– tofutim Jun 21 '11 at 20:32.

I think your example just needs a slight modification.... if (voices. Count > 0) { synth. SelectVoice(voices0.VoiceInfo.

Name); PromptBuilder pb = new PromptBuilder(); pb. AppendSsml(""); synth. Speak(pb); }.

I cant really gove you an answer,but what I can give you is a way to a solution, that is you have to find the anglde that you relate to or peaks your interest. A good paper is one that people get drawn into because it reaches them ln some way.As for me WW11 to me, I think of the holocaust and the effect it had on the survivors, their families and those who stood by and did nothing until it was too late.

Related Questions