say number by number

Home Forums OpenEars say number by number

Viewing 4 posts - 1 through 4 (of 4 total)

  • Author
    Posts
  • #9609
    sumdomo
    Participant

    HI
    Working on a text-to-speech (only need the flite class), is anyway I can have it to say number by number?
    i.e instead of one-thousand-two-hundred , say one-two-zero-zero

    thanks.

    #9610
    Halle Winkler
    Politepix

    Sure, this is just an implementation detail for you since you are controlling the string that is passed to FliteController. Instead of passing FliteController the word “1200”, pass “1” then “2” then “0” then “0”, or pass “one two zero zero”.

    #9611
    sumdomo
    Participant

    Thanks for your reply, but what if I have the NSString as “11234, SunWood Dr.”
    If I pass this to FliteController , it would became one thousand one hundred thirty four.
    You mean I have to convert to the string as “1 1 2 3 4 , SunWood Dr’?

    #9612
    Halle Winkler
    Politepix

    Correct, you need to create some method for parsing your text into the format that you need spoken. Flite doesn’t have a built-in system for detecting what kind of a number it is being given (this is a good thing since it would lead to wrong assumptions). Without knowing much about your requirements, something that is fairly simple might be to just try to detect the numbers 1-9 in your text string and replace them with the equivalent word (e.g. replace “1” with “one”, etc). But if you don’t know much about the text that is coming in, or you know that a “1” could mean more than one thing if it occurs in your text, this approach might be too primitive.

Viewing 4 posts - 1 through 4 (of 4 total)
  • You must be logged in to reply to this topic.