Text to speech idiosyncrasy
Moderators: winston, another_commander, Getafix
- Wildeblood
- ---- E L I T E ----
- Posts: 2453
- Joined: Sat Jun 11, 2011 6:07 am
- Location: Western Australia
- Contact:
Text to speech idiosyncrasy
When selecting a prime-able equipment item called "Cross-hairs selector", the text to speech engine announces "Credits oss-hair selector". I assume any other word beginning "Cr" would suffer similarly.
-
- Quite Grand Sub-Admiral
- Posts: 6682
- Joined: Wed Feb 28, 2007 7:54 am
Re: Text to speech idiosyncrasy
Actually the problem is that the " Cross-hair selector" string seems to have a space at its start. The speech engine will substitute "Cr" with "Credits" only when that space at start is present and the C in Cr is a capital one. If you try using the debug console to do after having set Spoken Messages to On, you will find that the message is spoken correctly.
Code: Select all
P.consoleMessage("Cross-hair selector")
- Wildeblood
- ---- E L I T E ----
- Posts: 2453
- Joined: Sat Jun 11, 2011 6:07 am
- Location: Western Australia
- Contact:
Re: Text to speech idiosyncrasy
I was about to apologize for raising a false alarm, and making such a noob mistake, then I thought I'd better check first.
This is the equipment.plist, and I don't see a leading space:-
This is the equipment.plist, and I don't see a leading space:-
Code: Select all
(
(
0, 0, "Cross-hairs Selector", "EQ_SELECTABLE_CROSSHAIRS", "",
{
"available_to_all" = "yes";
"damage_probability" = 0.0;
script = "selectable_crosshairs.js";
visible = "no";
}
)
)
-
- Quite Grand Sub-Admiral
- Posts: 6682
- Joined: Wed Feb 28, 2007 7:54 am
Re: Text to speech idiosyncrasy
Interesting. Maybe the leading space is added during processing of the string inside the script that handles the equipment? I only checked the case briefly using the debug console and the only way to have Cr spelled as Credits as to add that space.
- Wildeblood
- ---- E L I T E ----
- Posts: 2453
- Joined: Sat Jun 11, 2011 6:07 am
- Location: Western Australia
- Contact:
Re: Text to speech idiosyncrasy
I've just uploaded Select-o-matic Crosshairs, which is now available using the OXZ manager. I hear the same mis-pronunciation in Oolite 1.80 and the nightly build.
-
- Quite Grand Sub-Admiral
- Posts: 6682
- Joined: Wed Feb 28, 2007 7:54 am
Re: Text to speech idiosyncrasy
The extra space is added by the game, when setting up the string: "Equipment primed: Cross-hairs Selector". You can avoid the Cr-Credits substitution by adding a tab character at the beginning of the equipment's name in equipment.plist, which is invisible and therefore you bypass the problem. Like this:
Code: Select all
(
(
0, 0, "\tCross-hairs Selector", "EQ_SELECTABLE_CROSSHAIRS", "",
{
"available_to_all" = "yes";
"damage_probability" = 0.0;
script = "selectable_crosshairs.js";
visible = "no";
}
)
)
-
- ---- E L I T E ----
- Posts: 288
- Joined: Sat May 31, 2014 9:02 pm
- Location: Melbourne, Australia
Re: Text to speech idiosyncrasy
That seems a bit hacky...
Could the speech code possibly be modified to only do the credits substitution if the r in Cr isn't followed by another letter?
- Neelix
Could the speech code possibly be modified to only do the credits substitution if the r in Cr isn't followed by another letter?
- Neelix
Talaxian Enterprises: [wiki]Vacuum Pump[/wiki] [wiki]Waypoint Here[/wiki]
Re: Text to speech idiosyncrasy
Good point. IIRC there's a few planets whose names start with "Cr".Neelix wrote:That seems a bit hacky...
Could the speech code possibly be modified to only do the credits substitution if the r in Cr isn't followed by another letter?
- Neelix
Re: Text to speech idiosyncrasy
No, at least not straightforwardly. There's theNeelix wrote:Could the speech code possibly be modified to only do the credits substitution if the r in Cr isn't followed by another letter?
speech_pronunciation_guide.plist
file, so you could put a proper pronunciation for "Cross" into it - but because of the way it gets merged, the one for " Cr" will get picked up first.It seems slightly odd that in that file " cr." is "credits", but " Cr" (no trailing .) is also "credits" - but there are enough OXPs out there that use " Cr " for credits that it's probably got to stay that way.
We could add "Cross" to the core file - it's a common enough word or word-component that it's worth getting right. That would at least fix this case if not others. Looking through
descriptions.plist
, though, there are a lot of others.I think the correct fix - and looking at existing OXPs this shouldn't break anything - is to change the " Cr" in the core file to be " Cr " and " Cr." as two separate entries.
There are none, at least without OXPs - the name generation rules make that substring impossible.Zireael wrote:IIRC there's a few planets whose names start with "Cr".
-
- Mostly Harmless
- Posts: 2
- Joined: Sat Jan 17, 2015 1:33 am
Re: Text to speech idiosyncrasy
Hi everybody, I've recently upgraded my Oolite to 1.80 from 1.75something (brilliant job, guys!) and it's my first time posting here.
Anyway, I think there is a fairly straightforward way to fix this problem.
I encountered this after installing the Random Ship Names OXP (which is very good, by the way) - this generates ships with names like "Gecko: The Crow and Langoustine II", which the speech synthesizer renders as "Gecko: The Creditsow and Langoustine Roman Two".
I can just about live with "Roman Two" for "II", but "Creditsow" for "Crow"? I found the problem in the speech_pronunciation_guide.plist, and I think I've fixed it by creating another speech_pronunciation_guide.plist in my Add Ons folder - basically it allows Cr on its own to be pronounced "Credits", but Cr immediately followed by another letter gets pronounced correctly. I'll post the file here if I can figure out how to do so.
Anyway, I think there is a fairly straightforward way to fix this problem.
I encountered this after installing the Random Ship Names OXP (which is very good, by the way) - this generates ships with names like "Gecko: The Crow and Langoustine II", which the speech synthesizer renders as "Gecko: The Creditsow and Langoustine Roman Two".
I can just about live with "Roman Two" for "II", but "Creditsow" for "Crow"? I found the problem in the speech_pronunciation_guide.plist, and I think I've fixed it by creating another speech_pronunciation_guide.plist in my Add Ons folder - basically it allows Cr on its own to be pronounced "Credits", but Cr immediately followed by another letter gets pronounced correctly. I'll post the file here if I can figure out how to do so.
- Cody
- Sharp Shooter Spam Assassin
- Posts: 16081
- Joined: Sat Jul 04, 2009 9:31 pm
- Location: The Lizard's Claw
- Contact:
Re: Text to speech idiosyncrasy
Copy and paste thebananaboat wrote:I'll post the file here if I can figure out how to do so.
.plist
into a post, highlight it, then hit the 'Code' button - and welcome aboard, Commander!Alternatively, host it somewhere (Box or Dropbox, for example) and post a link.
I would advise stilts for the quagmires, and camels for the snowy hills
And any survivors, their debts I will certainly pay. There's always a way!
And any survivors, their debts I will certainly pay. There's always a way!
- Wildeblood
- ---- E L I T E ----
- Posts: 2453
- Joined: Sat Jun 11, 2011 6:07 am
- Location: Western Australia
- Contact:
Re: Text to speech idiosyncrasy
This one has already been fixed in trunk (1.81), BTW.
-
- Mostly Harmless
- Posts: 2
- Joined: Sat Jan 17, 2015 1:33 am
Re: Text to speech idiosyncrasy
Here goes:
Copy this lot into a file named speech_pronunciation_guide.plist and put it in your Add Ons folder. You don't need to do anything with the original speech_pronunciation_guide.plist in the Resources folder (I'm on Windows 32 bit - hope Mac etc. is the same)
This also includes roman numerals from 2 to 9 and a couple of other tweaks.
Code: Select all
(
// Format:
// (
// [required] Original text,
// [required] replacement text (Apple),
// [optional] replacement text (espeak) or "_" (original text is unchanged)
// )
(
" credits",
" Cr"
),
//main game sets "Cr" to "credits" - we need to re-set it
( "Cra", "cra" ),
( "Cre", "cre" ),
( "Cri", "cri" ),
( "Cro", "cro" ),
( "Cru", "cru" ),
( "Cry", "cry" ),
//correct Cr if followed by another letter (vowels and y)
( "Va", "va" ),
( "Ve", "ve" ),
( "Vi", "vi" ),
( "Vo", "vo" ),
( "Vu", "vu" ),
( "Vy", "vy" ),
( "Vl", "vl" ),
//roman numerals - if V is followed by another letter then not 5
( " IV", "Four" ),
( " VIII", "eight" ),
( " VII", "seven" ),
( " VI", "Six" ),
( " V", "Five" ),
( " III", "Three" ),
( " II", "Two" ),
( " IX", "nine" ),
//roman numerals - order is important
( "S.S. ", "s s " ),
// otherwise says "s dot s"
( "RRS", "R R S" ),
// tweak for RRS OXP
(
" Cr",
" credits"
),
// re-set "Cr" as per main game
)
This also includes roman numerals from 2 to 9 and a couple of other tweaks.
- fronclynne
- Deadly
- Posts: 149
- Joined: Sun Mar 01, 2009 5:36 am
- Location: ::1
Re: Text to speech idiosyncrasy
Aren't roman numerals normally used as ordinals in English? eg "second", "tertius", wha-have-you.