Text to speech idiosyncrasy

For test results, bug reports, announcements of new builds etc.

Moderators: winston, another_commander, Getafix

Post Reply
User avatar
Wildeblood
---- E L I T E ----
---- E L I T E ----
Posts: 2453
Joined: Sat Jun 11, 2011 6:07 am
Location: Western Australia
Contact:

Text to speech idiosyncrasy

Post by Wildeblood »

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.
another_commander
Quite Grand Sub-Admiral
Quite Grand Sub-Admiral
Posts: 6682
Joined: Wed Feb 28, 2007 7:54 am

Re: Text to speech idiosyncrasy

Post by another_commander »

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

Code: Select all

P.consoleMessage("Cross-hair selector")
after having set Spoken Messages to On, you will find that the message is spoken correctly.
User avatar
Wildeblood
---- E L I T E ----
---- E L I T E ----
Posts: 2453
Joined: Sat Jun 11, 2011 6:07 am
Location: Western Australia
Contact:

Re: Text to speech idiosyncrasy

Post by Wildeblood »

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:-

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";
        }
    )
)
another_commander
Quite Grand Sub-Admiral
Quite Grand Sub-Admiral
Posts: 6682
Joined: Wed Feb 28, 2007 7:54 am

Re: Text to speech idiosyncrasy

Post by another_commander »

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.
User avatar
Wildeblood
---- E L I T E ----
---- E L I T E ----
Posts: 2453
Joined: Sat Jun 11, 2011 6:07 am
Location: Western Australia
Contact:

Re: Text to speech idiosyncrasy

Post by Wildeblood »

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.
another_commander
Quite Grand Sub-Admiral
Quite Grand Sub-Admiral
Posts: 6682
Joined: Wed Feb 28, 2007 7:54 am

Re: Text to speech idiosyncrasy

Post by another_commander »

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";
        }
    )
)
Neelix
---- E L I T E ----
---- E L I T E ----
Posts: 288
Joined: Sat May 31, 2014 9:02 pm
Location: Melbourne, Australia

Re: Text to speech idiosyncrasy

Post by Neelix »

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
Talaxian Enterprises: [wiki]Vacuum Pump[/wiki] [wiki]Waypoint Here[/wiki]
Zireael
---- E L I T E ----
---- E L I T E ----
Posts: 1396
Joined: Tue Nov 09, 2010 1:44 pm

Re: Text to speech idiosyncrasy

Post by Zireael »

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
Good point. IIRC there's a few planets whose names start with "Cr".
User avatar
cim
Quite Grand Sub-Admiral
Quite Grand Sub-Admiral
Posts: 4072
Joined: Fri Nov 11, 2011 6:19 pm

Re: Text to speech idiosyncrasy

Post by cim »

Neelix 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?
No, at least not straightforwardly. There's the 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.
Zireael wrote:
IIRC there's a few planets whose names start with "Cr".
There are none, at least without OXPs - the name generation rules make that substring impossible.
bananaboat
Mostly Harmless
Mostly Harmless
Posts: 2
Joined: Sat Jan 17, 2015 1:33 am

Re: Text to speech idiosyncrasy

Post by bananaboat »

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.
User avatar
Cody
Sharp Shooter Spam Assassin
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

Post by Cody »

bananaboat wrote:
I'll post the file here if I can figure out how to do so.
Copy and paste the .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!
User avatar
Wildeblood
---- E L I T E ----
---- E L I T E ----
Posts: 2453
Joined: Sat Jun 11, 2011 6:07 am
Location: Western Australia
Contact:

Re: Text to speech idiosyncrasy

Post by Wildeblood »

This one has already been fixed in trunk (1.81), BTW.
bananaboat
Mostly Harmless
Mostly Harmless
Posts: 2
Joined: Sat Jan 17, 2015 1:33 am

Re: Text to speech idiosyncrasy

Post by bananaboat »

Here goes:

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

)
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.
User avatar
fronclynne
Deadly
Deadly
Posts: 149
Joined: Sun Mar 01, 2009 5:36 am
Location: ::1

Re: Text to speech idiosyncrasy

Post by fronclynne »

Aren't roman numerals normally used as ordinals in English? eg "second", "tertius", wha-have-you.
Post Reply