title: How to get pronunciation phonemes corresponding to a word using C#?
body: <p>I'll preface this by saying I'm very novice when it comes to C# programming. I'm working on an application for programmatically modifying the Windows Speech Dictionary using C# in conjunction with SAPI v5.4 (<a href="https://msdn.microsoft.com/en-us/library/ee125663(v=vs.85).aspx" rel="nofollow noreferrer">speechlib</a>). Everything is working well so far but I need to gain more insight about how strings are interpreted when they are synthesized (voiced). </p>
  
  <p>My understanding is that in SAPI 5.4 words are broken down into <a href="https://msdn.microsoft.com/en-us/library/ee431828(v=vs.85).aspx" rel="nofollow noreferrer">phoneme representations</a>, and I had some success getting word pronunciations to be "trained" correctly using the phonemes. I also know I can add words manually to the Windows Speech Recognition dictionary, provide a voice recording, and then extract the word's pronunciation (phonemes)...but this is cumbersome. It would also be useful to explore how the words are synthesized by default, i.e. without input from me (like how does the synthesizer interpret "dolphins"?).</p>
  
  <p>From a coding point of view here's what I've got so far:</p>
  
  <pre><code>using System;
  using System.Speech.Synthesis;
  
  namespace SpeechTest
  {
      class Program
      {
          static void Main(string[] args)
          {
              // Set up the speech synthesizer
              SpeechSynthesizer synthesizer = new SpeechSynthesizer();
              synthesizer.Volume = 100;
              synthesizer.Rate = -2;
  
              // Configure the audio output 
              synthesizer.SetOutputToDefaultAudioDevice();
  
              // Initialize string to store word of interest (not in the speech dictionary)
              string myWord = "dolphins";
  
              // Speak the word of interest
              synthesizer.Speak(myWord);
  
              // Retrieve pronunciation of myWord
              string myPronunciation = // *some code here*
  
              Console.WriteLine("Press any key to exit...");
              Console.ReadLine();
          }
      }
  }
  </code></pre>