expo-speech onBoundary text-to-speech callbacks do nothing

Please provide the following:

  1. SDK Version: 46.0.15
  2. Platforms(Android/iOS/web/all): native
  3. Add the appropriate “Tag” based on what Expo library you have a question on.

If I pass SpeechOptions to the Speech.speak() method like:

import { Button } from 'react-native'
import * as Speech from 'expo-speech'

function ExpoSpeech({ text }) {
  function handlePress() {
      Speech.speak(text, { onBoundary: e => console.log('onBoundary', e) });
  }

  return <Button onPress={handlePress} />;
}

I get no console logs for this.

Please see this Snack for a reproducible example. Here’s what you will see for the 2 event handlers, onBoundary and onDone, that I pass to Speech.speack():

  • Android - onBoundary never triggered, onDone triggered 1 time
  • iOS - same as Android
  • Web - onBoundary is triggered 3 times, onDone never triggered

I noticed other related (unanswered) forum posts as well:

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.