GO-Ve01
ServicesDevelopersBooksDictionaryPapersWikidataEncyclopediaSearchBabelCareersDeck

SpeechSynthesisEvent: charIndex property

Web Speech API

Web Speech API

The **`charIndex`** read-only property of the SpeechSynthesisUtterance interface returns the index position of the character in SpeechSynthesisUtterance.text that was being spoken when the event was triggered.

## Value

A number.

## Examples

```js
utterThis.onpause = (event) => {
const char = event.utterance.text.charAt(event.charIndex);
console.log(
`Speech paused at character ${event.charIndex} of "${event.utterance.text}", which is "${char}".`,
);
};
```

## Specifications

## Browser compatibility

## See also

- [Web Speech API](/docs/Web/API/Web_Speech_API)

source: MDN Web Docs mirror · page

Cite this

"SpeechSynthesisEvent: charIndex property". MDN Web Docs. CC BY-SA 2.5 (MDN). https://developer.mozilla.org/en-US/docs/Web/API/SpeechSynthesisEvent/charIndex

JSON record · API collection · BibTeX · RIS · CSL-JSON · citation policy

Save to pass ·