Ask Your Question
0

How to make speech synthesis read numbers like “1325.25” as “one three two five point two five”?

asked 2016-03-03 13:58:25 +0200

Kunjomachen gravatar image

updated 2016-03-07 14:32:07 +0200

Alex Kemp gravatar image

My OS is Ubuntu 15.10. In Libreoffice calc, I am using an extension "Read Text" to read numbers using Festival speech synthesis.

How to set up it to read numbers like "1325.25" as "one three two five point two five" instead of one thousand three hundred twenty-five point two five?. Is there any setting for that?

( I tried converting the number to text, but then the point is read as 'dot'.)

edit retag flag offensive close merge delete

1 Answer

Sort by » oldest newest most voted
1

answered 2016-03-03 14:35:16 +0200

Lupp gravatar image

updated 2016-03-03 21:38:37 +0200

I do not think this can be configured on the level of LibO.
The extension 'Read Text' should also only pass strings to the external application used to generate the words to speak and passing them again to the sound generator using the system's voices...
Did you already try to convert your numbers to read into strings consisting of isolated characters and spaces between like in "1 2 3 . 4 5"? If this works for you with a hand-typed example I can supply you with a custom function in BASIC doing the conversion.

Editing
For the moment I only can supply a function for protracted concatenation from my personal toolbox and a Calc document demonstrating how it can be used for the purpose if a few helper cells per number are dedicated. ask65534PrepareNumbersSpecificallyForSpeech001.ods

edit flag offensive delete link more

Comments

@Lupp Yes, please. That would be a great help. When I tried, the sound of each digit overlapped each other and so I add "wait" which made each of them sound as different numbers.

Kunjomachen gravatar imageKunjomachen ( 2016-03-03 16:20:32 +0200 )edit

@Lupp Thankyou. Your idea works fine. Converting the number to text and replacing "." by the word "point" does the job.

sub read_digits

'install extension - "read text" first

if ThisComponent.getCurrentSelection().value>=100 then

MyString=ThisComponent.getCurrentSelection.string

position= InStr(MyString,".")

length= Len(MyString)

digited=Left(MyString,position-1) & "point" & Right(MyString,Length-position)

MsgSpeak(digited)

End if

End sub

Kunjomachen gravatar imageKunjomachen ( 2016-03-04 12:33:50 +0200 )edit
Login/Signup to Answer

Question Tools

1 follower

Stats

Asked: 2016-03-03 13:58:25 +0200

Seen: 206 times

Last updated: Mar 03 '16