Speech output of phone numbers

Post your questions and help other users.

Moderator: Martin

Post Reply
BobF
Posts: 5
Joined: 04 Jan 2013 16:11

Speech output of phone numbers

Post by BobF » 24 Mar 2014 08:31

I feel sure there's a simple answer to this but I can't find it! :|
I have a flow which reads out when an incoming call arrives. It works fine if the caller is in my contacts, but if they're not, the speech output treats it as a number i.e. if the caller is 01234567890, it starts by saying something like "one billion, two hundred and thirty four thousand .." etc.

Anyone know a way to have it read digit by digit?

Joost van Gils
Posts: 19
Joined: 20 Mar 2014 09:00

Re: Speech output of phone numbers

Post by Joost van Gils » 24 Mar 2014 12:00

You should add a space after each digit. You can do this by adding a script action and code something like:

l=length(incoming_number);
counter=1;
while (counter<=l)
{
nr=nr + substring(incoming_number,counter,1) + " "; //Here the space is added
counter=counter+1;
}

The variable "nr" holds the Phone number with spaces in between....

BobF
Posts: 5
Joined: 04 Jan 2013 16:11

Re: Speech output of phone numbers

Post by BobF » 24 Mar 2014 12:37

As easy as that! I've tried that and it does the job. Just need to tinker with it now. Thank you very much!

BobF
Posts: 5
Joined: 04 Jan 2013 16:11

Re: Speech output of phone numbers

Post by BobF » 24 Mar 2014 14:58

I tried this, but if a phone number began with 0 (zero) the speech output said 'null' for that digit.
Quite by accident I found it seems there's an even simpler solution.

all that's needed is this:

nr = " " + incoming_number

This adds a space in front of the number.

I'm guessing this makes the speech engine see it as a string, and it then reads the caller's number out perfectly with the leading zero said as a 'zero'. All that said, the original idea was for the number to be read out to me while driving. Whichever way it reads it out, it struck me I won't be able to do much with it, so I may just go back to having it say 'unlisted' after all ! :D

Post Reply