Android TextToSpeech#speak Reading Integers SeperatelyIs there a way to run Python on Android?How to save an Android Activity state using save instance state?Activity restart on rotation AndroidClose/hide the Android Soft KeyboardWhy is the Android emulator so slow? How can we speed up the Android emulator?“Debug certificate expired” error in Eclipse Android pluginsIs there a unique Android device ID?What is the difference between gravity and layout_gravity in Android?What is 'Context' on Android?Proper use cases for Android UserManager.isUserAGoat()?
Why won't the Republicans use a superdelegate system like the DNC in their nomination process?
How can I find files in directories listed in a file?
How to prevent criminal gangs from making/buying guns?
Chunk + Enumerate a list of digits
Why not demand President's/candidate's financial records instead of tax returns?
Should I leave building the database for the end?
What is the hottest thing in the universe?
Why does Japan use the same type of AC power outlet as the US?
What kind of liquid can be seen 'leaking' from the upper surface of the wing of a Boeing 737-800?
Help, I cannot decide when to start the story
Dogfights in outer space
Are employers legally allowed to pay employees in goods and services equal to or greater than the minimum wage?
If a person claims to know anything could it be disproven by saying 'prove that we are not in a simulation'?
Cycle of actions and voice signals on a multipitch climb
Are there really no countries that protect Freedom of Speech as the United States does?
Link for download latest Edubuntu
Do I have to cite common CS algorithms?
Does an Irish VISA WARNING count as "refused entry at the border of any country other than the UK?"
Installing Windows to flash UEFI/ BIOS, then reinstalling Ubuntu
How can I find an old paper when the usual methods fail?
Running code generated in realtime in JavaScript with eval()
Is it OK to draw different current from L1 and L2 on NEMA 14-50?
Causal Diagrams using Wolfram?
When was "Fredo" an insult to Italian-Americans?
Android TextToSpeech#speak Reading Integers Seperately
Is there a way to run Python on Android?How to save an Android Activity state using save instance state?Activity restart on rotation AndroidClose/hide the Android Soft KeyboardWhy is the Android emulator so slow? How can we speed up the Android emulator?“Debug certificate expired” error in Eclipse Android pluginsIs there a unique Android device ID?What is the difference between gravity and layout_gravity in Android?What is 'Context' on Android?Proper use cases for Android UserManager.isUserAGoat()?
.everyoneloves__top-leaderboard:empty,.everyoneloves__mid-leaderboard:empty,.everyoneloves__bot-mid-leaderboard:empty margin-bottom:0;
I have some code:
tts.speak(Integer.toString(score), TextToSpeech.QUEUE_ADD, null);
Where score
is an int
between 0 and 100. Occasionally, but not very often, I will hear the digits ready separately ie "Eight Six" instead of "Eighty Six." Has anyone else experienced this? Any ideas short of a giant switch statement?
String to_read = "zero";
switch (score)
case 1: to_read = "one"; break;
case 2: to_read = "two"; break;
case 3: to_read = "three"; break;
case 4: to_read = "four"; break;
case 5: to_read = "five"; break;
...
tts.speak(to_read, TextToSpeech.QUEUE_ADD, null);
On second thought, a giant switch statement won't work very well unless we are going to add a hundred new strings to our Strings.xml and have them all translated...
android text-to-speech
add a comment |
I have some code:
tts.speak(Integer.toString(score), TextToSpeech.QUEUE_ADD, null);
Where score
is an int
between 0 and 100. Occasionally, but not very often, I will hear the digits ready separately ie "Eight Six" instead of "Eighty Six." Has anyone else experienced this? Any ideas short of a giant switch statement?
String to_read = "zero";
switch (score)
case 1: to_read = "one"; break;
case 2: to_read = "two"; break;
case 3: to_read = "three"; break;
case 4: to_read = "four"; break;
case 5: to_read = "five"; break;
...
tts.speak(to_read, TextToSpeech.QUEUE_ADD, null);
On second thought, a giant switch statement won't work very well unless we are going to add a hundred new strings to our Strings.xml and have them all translated...
android text-to-speech
As an alternative, a routine to produce the phonetic translation for a number [1..n] would not be terribly difficult - a quick search however did not yield any libraries so maybe more to it than i'm thinking. Obviously special cases for each position (million vs billion) and in particular teens and also "zero" which is not pronounced (e.g. 302) but doable and more scalable than a switch statement.
– Andy
Mar 27 at 11:42
TtsSpan seems interesting as well: developer.android.com/reference/android/text/style/TtsSpan.html. TYPE_DECIMAL
– Andy
Mar 27 at 11:55
add a comment |
I have some code:
tts.speak(Integer.toString(score), TextToSpeech.QUEUE_ADD, null);
Where score
is an int
between 0 and 100. Occasionally, but not very often, I will hear the digits ready separately ie "Eight Six" instead of "Eighty Six." Has anyone else experienced this? Any ideas short of a giant switch statement?
String to_read = "zero";
switch (score)
case 1: to_read = "one"; break;
case 2: to_read = "two"; break;
case 3: to_read = "three"; break;
case 4: to_read = "four"; break;
case 5: to_read = "five"; break;
...
tts.speak(to_read, TextToSpeech.QUEUE_ADD, null);
On second thought, a giant switch statement won't work very well unless we are going to add a hundred new strings to our Strings.xml and have them all translated...
android text-to-speech
I have some code:
tts.speak(Integer.toString(score), TextToSpeech.QUEUE_ADD, null);
Where score
is an int
between 0 and 100. Occasionally, but not very often, I will hear the digits ready separately ie "Eight Six" instead of "Eighty Six." Has anyone else experienced this? Any ideas short of a giant switch statement?
String to_read = "zero";
switch (score)
case 1: to_read = "one"; break;
case 2: to_read = "two"; break;
case 3: to_read = "three"; break;
case 4: to_read = "four"; break;
case 5: to_read = "five"; break;
...
tts.speak(to_read, TextToSpeech.QUEUE_ADD, null);
On second thought, a giant switch statement won't work very well unless we are going to add a hundred new strings to our Strings.xml and have them all translated...
android text-to-speech
android text-to-speech
asked Mar 27 at 11:23
Chase RobertsChase Roberts
4,9436 gold badges53 silver badges102 bronze badges
4,9436 gold badges53 silver badges102 bronze badges
As an alternative, a routine to produce the phonetic translation for a number [1..n] would not be terribly difficult - a quick search however did not yield any libraries so maybe more to it than i'm thinking. Obviously special cases for each position (million vs billion) and in particular teens and also "zero" which is not pronounced (e.g. 302) but doable and more scalable than a switch statement.
– Andy
Mar 27 at 11:42
TtsSpan seems interesting as well: developer.android.com/reference/android/text/style/TtsSpan.html. TYPE_DECIMAL
– Andy
Mar 27 at 11:55
add a comment |
As an alternative, a routine to produce the phonetic translation for a number [1..n] would not be terribly difficult - a quick search however did not yield any libraries so maybe more to it than i'm thinking. Obviously special cases for each position (million vs billion) and in particular teens and also "zero" which is not pronounced (e.g. 302) but doable and more scalable than a switch statement.
– Andy
Mar 27 at 11:42
TtsSpan seems interesting as well: developer.android.com/reference/android/text/style/TtsSpan.html. TYPE_DECIMAL
– Andy
Mar 27 at 11:55
As an alternative, a routine to produce the phonetic translation for a number [1..n] would not be terribly difficult - a quick search however did not yield any libraries so maybe more to it than i'm thinking. Obviously special cases for each position (million vs billion) and in particular teens and also "zero" which is not pronounced (e.g. 302) but doable and more scalable than a switch statement.
– Andy
Mar 27 at 11:42
As an alternative, a routine to produce the phonetic translation for a number [1..n] would not be terribly difficult - a quick search however did not yield any libraries so maybe more to it than i'm thinking. Obviously special cases for each position (million vs billion) and in particular teens and also "zero" which is not pronounced (e.g. 302) but doable and more scalable than a switch statement.
– Andy
Mar 27 at 11:42
TtsSpan seems interesting as well: developer.android.com/reference/android/text/style/TtsSpan.html. TYPE_DECIMAL
– Andy
Mar 27 at 11:55
TtsSpan seems interesting as well: developer.android.com/reference/android/text/style/TtsSpan.html. TYPE_DECIMAL
– Andy
Mar 27 at 11:55
add a comment |
1 Answer
1
active
oldest
votes
Since you're using QUEUE_ADD, and assuming you're rapidly adding random scores to the queue, maybe what you're actually hearing is:
- Two scores being read in succession that actually are single digit scores
- The trailing digit of a score (say, the 8 of twenty-eight) being read immediately before the next score which happens to be a single digit. "twenty-eight-six" is what is spoken, but your brain latches onto and remembers the "eight-six."
Aside from those possibilities, the basic fact is that you're not responsible for the internal behavior of any given TTS engine with regards to how it processes strings.
The user could have one of many/any engines (and sub-versions of those engines) and/or languages installed... all having potentially different behaviors, so if you try to compensate for the engine you are testing with, it's only going to open a can of worms and cause unpredictable/unwanted results on the remaining engines.
add a comment |
Your Answer
StackExchange.ifUsing("editor", function ()
StackExchange.using("externalEditor", function ()
StackExchange.using("snippets", function ()
StackExchange.snippets.init();
);
);
, "code-snippets");
StackExchange.ready(function()
var channelOptions =
tags: "".split(" "),
id: "1"
;
initTagRenderer("".split(" "), "".split(" "), channelOptions);
StackExchange.using("externalEditor", function()
// Have to fire editor after snippets, if snippets enabled
if (StackExchange.settings.snippets.snippetsEnabled)
StackExchange.using("snippets", function()
createEditor();
);
else
createEditor();
);
function createEditor()
StackExchange.prepareEditor(
heartbeatType: 'answer',
autoActivateHeartbeat: false,
convertImagesToLinks: true,
noModals: true,
showLowRepImageUploadWarning: true,
reputationToPostImages: 10,
bindNavPrevention: true,
postfix: "",
imageUploader:
brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
allowUrls: true
,
onDemand: true,
discardSelector: ".discard-answer"
,immediatelyShowMarkdownHelp:true
);
);
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
StackExchange.ready(
function ()
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f55376009%2fandroid-texttospeechspeak-reading-integers-seperately%23new-answer', 'question_page');
);
Post as a guest
Required, but never shown
1 Answer
1
active
oldest
votes
1 Answer
1
active
oldest
votes
active
oldest
votes
active
oldest
votes
Since you're using QUEUE_ADD, and assuming you're rapidly adding random scores to the queue, maybe what you're actually hearing is:
- Two scores being read in succession that actually are single digit scores
- The trailing digit of a score (say, the 8 of twenty-eight) being read immediately before the next score which happens to be a single digit. "twenty-eight-six" is what is spoken, but your brain latches onto and remembers the "eight-six."
Aside from those possibilities, the basic fact is that you're not responsible for the internal behavior of any given TTS engine with regards to how it processes strings.
The user could have one of many/any engines (and sub-versions of those engines) and/or languages installed... all having potentially different behaviors, so if you try to compensate for the engine you are testing with, it's only going to open a can of worms and cause unpredictable/unwanted results on the remaining engines.
add a comment |
Since you're using QUEUE_ADD, and assuming you're rapidly adding random scores to the queue, maybe what you're actually hearing is:
- Two scores being read in succession that actually are single digit scores
- The trailing digit of a score (say, the 8 of twenty-eight) being read immediately before the next score which happens to be a single digit. "twenty-eight-six" is what is spoken, but your brain latches onto and remembers the "eight-six."
Aside from those possibilities, the basic fact is that you're not responsible for the internal behavior of any given TTS engine with regards to how it processes strings.
The user could have one of many/any engines (and sub-versions of those engines) and/or languages installed... all having potentially different behaviors, so if you try to compensate for the engine you are testing with, it's only going to open a can of worms and cause unpredictable/unwanted results on the remaining engines.
add a comment |
Since you're using QUEUE_ADD, and assuming you're rapidly adding random scores to the queue, maybe what you're actually hearing is:
- Two scores being read in succession that actually are single digit scores
- The trailing digit of a score (say, the 8 of twenty-eight) being read immediately before the next score which happens to be a single digit. "twenty-eight-six" is what is spoken, but your brain latches onto and remembers the "eight-six."
Aside from those possibilities, the basic fact is that you're not responsible for the internal behavior of any given TTS engine with regards to how it processes strings.
The user could have one of many/any engines (and sub-versions of those engines) and/or languages installed... all having potentially different behaviors, so if you try to compensate for the engine you are testing with, it's only going to open a can of worms and cause unpredictable/unwanted results on the remaining engines.
Since you're using QUEUE_ADD, and assuming you're rapidly adding random scores to the queue, maybe what you're actually hearing is:
- Two scores being read in succession that actually are single digit scores
- The trailing digit of a score (say, the 8 of twenty-eight) being read immediately before the next score which happens to be a single digit. "twenty-eight-six" is what is spoken, but your brain latches onto and remembers the "eight-six."
Aside from those possibilities, the basic fact is that you're not responsible for the internal behavior of any given TTS engine with regards to how it processes strings.
The user could have one of many/any engines (and sub-versions of those engines) and/or languages installed... all having potentially different behaviors, so if you try to compensate for the engine you are testing with, it's only going to open a can of worms and cause unpredictable/unwanted results on the remaining engines.
answered Mar 27 at 22:12
Boober BunzBoober Bunz
1,16912 silver badges38 bronze badges
1,16912 silver badges38 bronze badges
add a comment |
add a comment |
Got a question that you can’t ask on public Stack Overflow? Learn more about sharing private information with Stack Overflow for Teams.
Got a question that you can’t ask on public Stack Overflow? Learn more about sharing private information with Stack Overflow for Teams.
Thanks for contributing an answer to Stack Overflow!
- Please be sure to answer the question. Provide details and share your research!
But avoid …
- Asking for help, clarification, or responding to other answers.
- Making statements based on opinion; back them up with references or personal experience.
To learn more, see our tips on writing great answers.
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
StackExchange.ready(
function ()
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f55376009%2fandroid-texttospeechspeak-reading-integers-seperately%23new-answer', 'question_page');
);
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
As an alternative, a routine to produce the phonetic translation for a number [1..n] would not be terribly difficult - a quick search however did not yield any libraries so maybe more to it than i'm thinking. Obviously special cases for each position (million vs billion) and in particular teens and also "zero" which is not pronounced (e.g. 302) but doable and more scalable than a switch statement.
– Andy
Mar 27 at 11:42
TtsSpan seems interesting as well: developer.android.com/reference/android/text/style/TtsSpan.html. TYPE_DECIMAL
– Andy
Mar 27 at 11:55