Groups keyboard shortcuts have been updated
Dismiss
See shortcuts

Error in create_vowel() of Praat Vocal Toolkit

80 views
Skip to first unread message

Pr S

unread,
Jun 13, 2022, 9:02:24 AM6/13/22
to Parselmouth
Hi,
I am trying to call the create_vowel() script of the Praat Vocal Toolkit using parselmouth.

The input comes from a JSON file where the vowel is given as the following string :
"ɪ\tih\t\"hid\""

Code statements are:
toolkit_file= os.path.join(".", PRAAT_VOCAL_TOOLKIT, "createvowel.praat")

manip_obj = parselmouth.praat.run_file (sound, toolkit_file,       duration_seconds, f0_range_start, f0_range_end, f1, f2, f3, f4,
            preset_vowel, speaker, vowel, synth_method, PREVIEW)


The following Praat error occurs:
Unknown value "ɪ  ih      "hid"" for option menu "Vowel".
Script not completed.

However, when I give the JSON input string as :
"i\tiy\t\"heed\""
there is no error.

Could you guide me on how to solve this problem.

Thanks & Regards,
Preetha.

yannick...@gmail.com

unread,
Jun 15, 2022, 7:33:07 AM6/15/22
to Parselmouth
Hi Preetha

Thank you for reporting!

I have just tried myself, and this works for me:

```parselmouth.praat.run_file("/home/yannick/plugin_VocalToolkit/createvowel.praat", 0.8, 150, 100, 500, 1500, 2500, 3500, True, 'Man', 'ɪ\tih\t"hid"', 'VowelEditor (4 formants)', False)[0].save("TEST.wav", 'WAV')```

But since this "ɪ" is not Latin script but Unicode, I guess that's where the issue is. There are a few things to check out:
1. You're using Python 3 right? Python 2 makes a bit of a mess of Unicode handling (and is dead, anyway).
2. Check the encoding in which you're saving the Python script file. Try to make sure it's saved as UTF-8, since that's Python's default
4. Probably the easiest workaround (but not solving the issue at its core): just enter the \uxxxx code of the IPA symbol. In this case: `'\u026A\tih\t"hid"'`. (see https://www.compart.com/en/unicode/U+026A)

If these suggestions do not work, please get back to me with a few more details (i.e., running on Windows? Which Python version? Which Windows language settings?) and I'll look further into this!

It's quite messy to enter these strings, I agree. But then again, there's something amazing about it actually working in Python, as well? :-)

Kind regards
Yannick

Pr S

unread,
Jun 20, 2022, 7:08:48 AM6/20/22
to yannick...@gmail.com, Parselmouth
Hello,

Thank you for the detailed response. 

I was able to fix all the cases except :
'\u0075\tuw\t"who'd"'.

I also tried :
'\u0075\tuw\t"who\u0027d"'

but it does not work. Could you guide me on this please?

Regards,
Preetha.

--
You received this message because you are subscribed to a topic in the Google Groups "Parselmouth" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/parselmouth/Ee9-6jGnLtc/unsubscribe.
To unsubscribe from this group and all its topics, send an email to parselmouth...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/parselmouth/e8db6aed-b739-4a04-9b0b-e39eb131810en%40googlegroups.com.

yannick...@gmail.com

unread,
Jun 20, 2022, 7:34:05 PM6/20/22
to Parselmouth
Hi Preetha

Once again, a bit of an annoying answer, but I think you'll need to use '\u0075\tuw\t"who\u2019d"'.
The reason is that the option listed in "createvowel.praat" does not have a simple single quote (https://www.compart.com/en/unicode/U+0027) but a curly one (https://www.compart.com/en/unicode/U+2019). I have no idea why, but it is the case.

As you have to match the options from the "form" in "createvowel.praat" perfectly, that's why. It's again annoying, but, it would be the same when trying to use "createvowel.praat" from an actual Praat script in Praat (and not just the GUI), I think.

Either way, I hope this solves your problem?

Kind regards
Yannick
Reply all
Reply to author
Forward
0 new messages