An AudioNumber object represents a numeric value. To set the value property, you must use a double.
The number can be read out in several different ways, according to the style property inherited from the MediaType superclass.
For the AudioNumber class, the style property can have the following values
(note that the locale property of the MediaType class
may also affect how the number is spoken):
- Integer: This is the default. Plays the number as
an integer and in words. For example, 305,004,042 is played in English as
"three hundred and five million, four thousand and forty-two". In most languages
this will support numbers up to 999,999,999. Any fractional part is ignored.
Any number greater than or equal to 1012 is played
in the Digits style.
- Digits: Plays the number as a string of digits.
For example, 305,004,042 is played in English as "three zero five zero zero
four zero four two". If the number is negative, it is preceded by the word
"minus".
- Counter: In most languages, plays the same as Integer,
but some languages treats numbers differently if they represent a count rather
than some other form of number.
- Phone: Only available for en_US and en_GB locales.
Now deprecated: use Digits in new applications.
- Real: Only available for en_US and en_GB locales.
The value is spoken as a real number, fractional up to two decimal places.
Any number greater than or equal to 1012 is played
in the Phone style.
Note that 1 billion is used to mean 1 thousand million in both the en_US
and en_GB locales.
The constructor methods for this class are:
- AudioNumber()
- Constructs an audio number object with a value of zero and a style
of Integer. You can set these properties later using the methods setValue() and setStyle().
- AudioNumber(double value)
- Constructs an audio number object with the specified value and a style
of Integer.
- AudioNumber(double value, java.lang.String style)
- Constructs an audio number object with the specified value and style.
For example:
public class InApp extends WVRApplication {
// Create an audio number
public AudioNumber code = new AudioNumber(118257, "Digits");
.
.
.
}