Hey how can i implement something like this script example from the forum...
"value = "00411234567"; optimized_value = replaceAll(value, "(.)", "$1 "); log(optimized_value);// 0 0 4 1 1 2 3 4 5 6 7"
TO THESE VARIABLES WHEN USING SPEECH OUTPUT...
"incoming_number or sms_sender"
Spoken number format
Moderator: Martin
Re: Spoken number format
just replace the variable name right?
Use {speak} in the speech output.
Code: Select all
speak = replaceAll(incoming_number, "(.)", "$1 ");
Index of Automagic useful thread List of my other useful posts (and others')
Xiaomi Redmi Note 5 (whyred), AOSP Extended v6.7 build 20200310 Official, Android Pie 9.0, Rooted.
Xiaomi Redmi Note 5 (whyred), AOSP Extended v6.7 build 20200310 Official, Android Pie 9.0, Rooted.
Re: Spoken number format
Sorry... yeah i got it figured out. Thank you
-
- Posts: 179
- Joined: 16 Oct 2019 17:38
Re: Spoken number format
Hi
I've something similar to this, which I solved by my crude method approach. I'm expecting you could do better.
The string contains something like "BATMAN PREMIERES ON TELEVISION 1966"
1966 needs to be split into 19 66 to be spoken properly.
I've done it like so: (Feel free to laugh)
a = "BATMAN PREMIERES ON TELEVISION 1966";
b = findAll(a,"[0-9]");
len = length (b);
len == 4;
c = join (b, ",");
d = replace (c, ",","");
addElement (b, 2, " ");
f = join (b, ",");
g = replace (f, ",","");
a = replace (a, d, g);
a = trim (a);
Note I check the length so it only applies to years and not to other numbers in the string.
Thanks
I've something similar to this, which I solved by my crude method approach. I'm expecting you could do better.
The string contains something like "BATMAN PREMIERES ON TELEVISION 1966"
1966 needs to be split into 19 66 to be spoken properly.
I've done it like so: (Feel free to laugh)
a = "BATMAN PREMIERES ON TELEVISION 1966";
b = findAll(a,"[0-9]");
len = length (b);
len == 4;
c = join (b, ",");
d = replace (c, ",","");
addElement (b, 2, " ");
f = join (b, ",");
g = replace (f, ",","");
a = replace (a, d, g);
a = trim (a);
Note I check the length so it only applies to years and not to other numbers in the string.
Thanks
Crude but it works.