// Date pronunciation
voice.sayAs('2025-12-31', { interpretAs: 'date', format: 'ymd' });
// Currency with detail
voice.sayAs('\$42.50', { interpretAs: 'currency', detail: 'USD' });
// Phone number
voice.sayAs('1-800-555-1234', { interpretAs: 'telephone' });
// Ordinal number
voice.sayAs('3', { interpretAs: 'ordinal' }); // "third"
Interpretation types for the say-as element.
Specifies how text should be interpreted and pronounced. Essential for proper pronunciation of numbers, dates, times, and other formatted text.
Types:
address
: Street addressescardinal
: Cardinal numbers (1, 2, 3)characters
: Spell out each characterdate
: Date valuesdigits
: Speak each digit individuallyfraction
: Fractions (1/2, 3/4)ordinal
: Ordinal numbers (1st, 2nd, 3rd)spell-out
: Spell out the entire wordtelephone
: Phone numberstime
: Time valuesname
: Personal namescurrency
: Monetary amounts