Pronunciation of hours, minutes and seconds!

Forum for TextAloud version 3

Moderator: Jim Bretti

Post Reply
Jackson
Posts: 4
Joined: Thu May 23, 2019 4:06 am
Contact:

Pronunciation of hours, minutes and seconds!

Post by Jackson »

Hey there,

Recently purchased acapela Rachel for textaloud 3.

Most of my dictionary seems to fix most the problems i'm coming across, but cant seems to figure out how to get her to speak 00:02:01 (for example) in hours, minutes and seconds. It sounds like its being pronounced as 'O and Two seconds, O One.'
I'm trying to get her to say 'Zero hours, Two Minutes and One Second.'

Listening the the Default voice (Microsoft Anna) doesn't seem to be having this problem! Not sure if its something in my current dictionary which will be causing this problem (I hope not as its getting rather large now!) or something i need to add?

Any help will be greatly appreciated!!

Jack
Jim Bretti
Posts: 1558
Joined: Wed Oct 29, 2003 11:07 am
Contact:

Re: Pronunciation of hours, minutes and seconds!

Post by Jim Bretti »

Hi Jack

I can't find a way to handle this using any sapi5 control tags. There is a <context> tag that is supposed to handle problems like this but I can't get it to work. I think you may be able to handle with a TextAloud pronunciation dictionary entry using a regular expression to match the time strings in your text. The expression will need to strip leading 0's from hour, minute and second, here is something you can try.

Create a TextAloud pronunciation dictionary entry, and set the Text Matching dropdown to "Regular Expression". For the expression, use this:

0*(\d{1,2}):0*(\d{1,2}):0*(\d{1,2})

Then set the Pronounce Using dropdown to "Respell", and for the respelling, use:

$1 hours, $2 minutes and $3 seconds

The regular expression is matching the pattern hh:mm:ss, where it ignores the leading 0 if present, and captures the digit after the 0. If no leading 0 is present it captures both digits. In the Respell field, reference the matched digits using $1, $2 and $3, where the $ numbers correspond to parentheses pairs in the expression.

Let me know if that doesn't work.
Jim Bretti
NextUp.com
Jackson
Posts: 4
Joined: Thu May 23, 2019 4:06 am
Contact:

Re: Pronunciation of hours, minutes and seconds!

Post by Jackson »

Amazing! as far as i can tell everything now works perfectly!

I think the only tiny issue is that after saying 'x hours, x minutes, x seconds' she sounds like shes asking a question! (Not sure if there would be anyway of fixing this problem with the entry added?)

Thanks!
Jack
Jim Bretti
Posts: 1558
Joined: Wed Oct 29, 2003 11:07 am
Contact:

Re: Pronunciation of hours, minutes and seconds!

Post by Jim Bretti »

Glad to hear that works.

I'm not sure if we can fix the intonation problem, could you post a few sample sentences where this is happening? Its possible we can adjust the dictionary entry to handle.
Jim Bretti
NextUp.com
Jackson
Posts: 4
Joined: Thu May 23, 2019 4:06 am
Contact:

Re: Pronunciation of hours, minutes and seconds!

Post by Jackson »

I have large section with multiple chunks of texts like this:

Mon 1 Apr; 09:12; 09999999999; mobile; 00:00:04; 00:01:00; Yes; £0.000; 20%; £0.000
Mon 1 Apr; 09:12; 09999999999; mobile; 00:00:04; 00:01:00; Yes; £0.000; 20%; £0.000
Mon 1 Apr; 09:12; 09999999999; mobile; 00:00:04; 00:01:00; Yes; £0.000; 20%; £0.000

it sounds like Mon 1 Apr; 09:12; 09999999999?; 00:00:04; etc..

I dont have the slightest clue how i would be able to fix this in the dictionary!! :oops:
Jim Bretti
Posts: 1558
Joined: Wed Oct 29, 2003 11:07 am
Contact:

Re: Pronunciation of hours, minutes and seconds!

Post by Jim Bretti »

Thanks for sending the sample text. I'm hearing the incorrect intonation as well, but I'm also hearing it after the text 09:12. Our regular expression is not touching this text, it is only acting on text that matches this pattern: hh:mm:ss.

I think the problem has something to do with some (not all) semi-colons in the text. There are a couple ways you could handle. One possibility is to add another dictionary entry that converts semi-colons to periods. You may want to create a separate dictionary, just for Rachel, for this kind of change When creating the dictionary, set the Voice association to Acapela Rachel. If you happen to use other voices, the semi-colon will be handled normally, but when using Rachel, all semi-colons will be replaced with periods.

The dictionary entry looks like this:

Text Matching: Simple Text
For the text, enter a single semi-colon character: ;
Pronounce Using: Respell
For the respelling, enter a single period: .
You also need to set the Word Boundary Condition to "No Word Boundary required".

With this entry active, Rachel should use the correct intonation at *all* semi-colons.


If the timestamps in your text are always followed by semi-colons, another possibility would be to adjust the original dictionary entry to include the semi-colon in the text to match, and replace with a period in the respelling

So the original dictionary entry could change to this:
Regular expression:
0*(\d{1,2}):0*(\d{1,2}):0*(\d{1,2});

Respell
$1 hours, $2 minutes and $3 seconds.

Note the trailing semi-colon in the regular expression and the trailing period in the respelling. This dictionary would fix the intonation problem at the timestamps, but you may have other places in the text where text followed by a semi-colon is pronounced like a question.

Let me know if you have any questions.
Jim Bretti
NextUp.com
Post Reply