Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Issue with <phoneme> SSML tag #20

Open
Bharath-Kumar-3231 opened this issue Nov 25, 2021 · 3 comments
Open

Issue with <phoneme> SSML tag #20

Bharath-Kumar-3231 opened this issue Nov 25, 2021 · 3 comments

Comments

@Bharath-Kumar-3231
Copy link

Bharath-Kumar-3231 commented Nov 25, 2021

Hi,
I am trying to use the phoneme tag in SSML text, but the output phones are split up

from gruut import sentences

ssml_text = """
  <phoneme ph="aːˈb" alphabet="ipa">ab</phoneme>"""

for sent in sentences(ssml_text, ssml=True,espeak=True):
  for word in sent:
    if word.phonemes:
      print(word.text,word.phonemes)

The following is the output obtained

ab ['a', 'ː', 'ˈ', 'b']

but the expected output phones for word ab are

ab ['aː', 'ˈb']

i only used the steps mentioned in documentation, Am i doing something wrong? or is it an issue with gruut in itself.

Thank you

@Bharath-Kumar-3231
Copy link
Author

According to the documentation gruut is supposed to intelligently split the given ipa phoenems, but that isnt happening

<phoneme ph="..."> - supply phonemes for inner text
alphabet - if ipa, phonemes are intelligently split ("aːˈb" -> "aː", "ˈb")

@synesthesiam
Copy link
Contributor

Hi @Bharath-Kumar-3231, this is a good question. I originally did the "intelligent" split on phonemes, but had problems when the system using gruut needed them split differently -- for example, seeing as a single phoneme.

So now you can separate phonemes by whitespace and gruut will respect that:

<phoneme ph="aː ˈb" alphabet="ipa">ab</phoneme>

should produce the expected output.

Let me know what your thoughts are. I felt this was my only option since some TTS systems consider elongation ː and primary stress ˈ as separate "phonemes".

@liaeh
Copy link

liaeh commented Sep 27, 2022

The phoneme tag doesn't behave as expected. I.e. continuing the example above,

from gruut import sentences

ssml_text = """
  <phoneme ph="aːˈb" alphabet="ipa">ab</phoneme>"""

for sent in sentences(ssml_text, ssml=True,espeak=True):
  for word in sent:
    if word.phonemes:
      print(word.text,word.phonemes)

prints ab ['ˈ', 'b'] instead of the expected ['aː', 'ˈb'].

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants