Skip to content

Don't pass quotes to espeak - #3286

Merged
erogol merged 1 commit into
coqui-ai:devfrom
idiap:fix-espeak
Nov 24, 2023
Merged

erogol merged 1 commit into
coqui-ai:devfrom
idiap:fix-espeak

Conversation

@eginhard

@eginhard eginhard commented Nov 22, 2023 •

Copy link
Copy Markdown
Contributor

Previously, the text was wrapped in an additional set of quotes that was passed to Espeak. This could result in different phonemization in certain edge cases (it didn't allow to pronounce A as a letter) and caused the insertion of an initial separator "_" that had to be removed. Compare:

$ espeak-ng -q -b 1 -v en-us --ipa=1 '"A"'
_ˈɐ
$ espeak-ng -q -b 1 -v en-us --ipa=1 'A'
ˈeɪ

Fixes #2619

Previously, the text was wrapped in an additional set of quotes that was passed
to Espeak. This could result in different phonemization in certain edges and
caused the insertion of an initial separator "_" that had to be removed.
Compare:
$ espeak-ng -q -b 1 -v en-us --ipa=1 '"A"'
_ˈɐ
$ espeak-ng -q -b 1 -v en-us --ipa=1 'A'
ˈeɪ

Fixes coqui-ai#2619
@erogol

erogol commented Nov 22, 2023

Copy link
Copy Markdown
Member

Do we use ' ' as passing it to espeak, otherwise we might have issues with special chars? Although I wrote the code it is alien to me now.

@eginhard

Copy link
Copy Markdown
Contributor Author

Sorry, I'm not completely sure what you mean. The actual call to Espeak is via subprocess, which would handle the quoting, e.g. like this:

subprocess.Popen(['espeak-ng', '-q', '-b', '1', '-v', 'en-us', '--ipa=1', text])

Here I changed text = '"A B C"' to text = "A B C". The extra pair of quotes were just passed as literal quote characters and have no effect on any special character processing...

@erogol

erogol commented Nov 24, 2023

Copy link
Copy Markdown
Member

ohh ok I didn't know subprocess handling the quotes. Then all should be fine.

@erogol
erogol merged commit 2af0220 into coqui-ai:dev Nov 24, 2023
@arbianqx

Copy link
Copy Markdown

This PR, breaks phoneme_cache computation, when initiating a new training.

@eginhard

Copy link
Copy Markdown
Contributor Author

This PR, breaks phoneme_cache computation, when initiating a new training.

@arbianqx Could you share some details about the error and training recipe/dataset/language?

@arbianqx

Copy link
Copy Markdown

Happening in albanian language, on vits recipe. Dataset is in vctk format.

@eginhard

Copy link
Copy Markdown
Contributor Author

@arbianqx What is the exact error message?

@arbianqx

Copy link
Copy Markdown

@eginhard It gets stuck at a random number, perhaps when it gets to a special char.

@eginhard

Copy link
Copy Markdown
Contributor Author

@arbianqx If you could share the error message and for which exact input it occurs that would be helpful. I phonemized some Albanian text and didn't see any obvious issues...

@arbianqx

Copy link
Copy Markdown

@eginhard I would love to share logs if any, because it just hangs there. Anyway, I'll see if I encounter this again. I'll try with a different dataset when I'll have the chance!

@eginhard
eginhard deleted the fix-espeak branch March 30, 2024 21:10
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

Successfully merging this pull request may close these issues.

[Bug] Letter-by-letter pronunciation not possible

3 participants