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;








1















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...










share|improve this question
























  • 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


















1















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...










share|improve this question
























  • 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














1












1








1


1






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...










share|improve this question














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






share|improve this question













share|improve this question











share|improve this question




share|improve this question










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


















  • 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













1 Answer
1






active

oldest

votes


















0














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.






share|improve this answer
























    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
    );



    );













    draft saved

    draft discarded


















    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









    0














    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.






    share|improve this answer





























      0














      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.






      share|improve this answer



























        0












        0








        0







        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.






        share|improve this answer













        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.







        share|improve this answer












        share|improve this answer



        share|improve this answer










        answered Mar 27 at 22:12









        Boober BunzBoober Bunz

        1,16912 silver badges38 bronze badges




        1,16912 silver badges38 bronze badges





















            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.



















            draft saved

            draft discarded
















































            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.




            draft saved


            draft discarded














            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





















































            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







            Popular posts from this blog

            Kamusi Yaliyomo Aina za kamusi | Muundo wa kamusi | Faida za kamusi | Dhima ya picha katika kamusi | Marejeo | Tazama pia | Viungo vya nje | UrambazajiKuhusu kamusiGo-SwahiliWiki-KamusiKamusi ya Kiswahili na Kiingerezakuihariri na kuongeza habari

            Swift 4 - func physicsWorld not invoked on collision? The Next CEO of Stack OverflowHow to call Objective-C code from Swift#ifdef replacement in the Swift language@selector() in Swift?#pragma mark in Swift?Swift for loop: for index, element in array?dispatch_after - GCD in Swift?Swift Beta performance: sorting arraysSplit a String into an array in Swift?The use of Swift 3 @objc inference in Swift 4 mode is deprecated?How to optimize UITableViewCell, because my UITableView lags

            Access current req object everywhere in Node.js ExpressWhy are global variables considered bad practice? (node.js)Using req & res across functionsHow do I get the path to the current script with Node.js?What is Node.js' Connect, Express and “middleware”?Node.js w/ express error handling in callbackHow to access the GET parameters after “?” in Express?Modify Node.js req object parametersAccess “app” variable inside of ExpressJS/ConnectJS middleware?Node.js Express app - request objectAngular Http Module considered middleware?Session variables in ExpressJSAdd properties to the req object in expressjs with Typescript