4

I have a bunch of x-sampa phonetic transcriptions like "p_hleIs that I would like to use with SAPI 5.

Is this possible?

user3900456
  • 2,003
  • 3
  • 25
  • 33

1 Answers1

0

I don't believe so, no. It does, however, support IPA which, from what I understand, X-SAMPA was extended so that it could translate well to IPA.

W3.org Actually covers how to do this when you ingest XML grammars into SAPI. If you wanted to use IPA on the fly, however, in C++ I do something like:

m_cpVoice->Speak(L"His name is <phoneme alphabet=\"ipa\" ph=\"ɹəˈbɛːɹɾoʊ bɛˈniːnji\">Roberto Benigni</phoneme>", SVSFIsXML, NULL);

If you can't use wide chars for whatever reason, you might have to translate to unicode like:

m_cpVoice->Speak(L"His name is<phoneme alphabet=\"ipa\" ph=\"&#x2C8;l&#x251; &#x2C8;vi&#x2D0;&#x27E;&#x259; &#x2C8;&#x294;e&#x26A; &#x2C8;b&#x25B;l&#x259;\"">La vita e bella </phoneme>", SVSFIsXML, NULL);

Which admittedly looks terrible.

It's probably not all the different to do in C#.

Lesley Gushurst
  • 664
  • 4
  • 15
  • I tested the solution you suggested, but it does not work. Microsoft SAPI does not support these kind of markup. If you want to use phonemes, you have to use the markups supported by SAPI. [Here](https://learn.microsoft.com/en-us/previous-versions/windows/desktop/ee431828%28v%3dvs.85%29) is more [information](https://learn.microsoft.com/en-us/previous-versions/windows/desktop/ee125675%28v%3dvs.85%29) – georges619 Mar 28 '19 at 15:35