expo: playsInSilentModeIOS does not influence Speech.speak

🐛 Bug Report

Summary of Issue

The following API call should set the audio mode such that all audio playback is played even in iOS silent mode:

import { Audio } from 'expo-av';

...

Audio.setAudioModeAsync({
  playsInSilentModeIOS: true,
})

After this, we call

import * as Speech from 'expo-speech'

...

Speech.speak(text, { language: 'en' })

Even though we have set playsInSilentModeIOS to true, the text-to-speech output is not played when the device is in silent mode.

Environment - output of expo diagnostics & the platform(s) you’re targeting

Platform: iOS

expo diagnostics:

  Expo CLI 3.28.2 environment info:
    System:
      OS: Windows 10 10.0.18362
    Binaries:
      Node: 12.18.2 - C:\Program Files\nodejs\node.EXE
      Yarn: 1.15.2 - C:\Program Files (x86)\Yarn\bin\yarn.CMD
      npm: 6.14.5 - C:\Program Files\nodejs\npm.CMD
    IDEs:
      Android Studio: Version  3.3.0.0 AI-182.5107.16.33.5314842
    npmPackages:
      expo: ^39.0.3 => 39.0.3
      react: 16.13.1 => 16.13.1
      react-dom: 16.13.1 => 16.13.1
      react-native: https://github.com/expo/react-native/archive/sdk-39.0.2.tar.gz => 0.63.2
      react-native-web: ~0.13.7 => 0.13.14
      react-navigation: ^4.1.0 => 4.4.1
    Expo Workflow: bare

Reproducible Demo

https://snack.expo.io/@yolpsoftware/playsinsilentmodeios

Expected Behavior vs Actual Behavior

Expected behavior: Text-to-speech output should play in silent mode.

Actual behavior: Text-to-speech output doesn’t play in silent mode.

Note

If the expo-av API should not have any influence on expo-speech, then you should include a playsInSilentModeIOS API in expo-speech as well.

This might be relevant.

About this issue

  • Original URL
  • State: open
  • Created 4 years ago
  • Reactions: 4
  • Comments: 26 (5 by maintainers)

Most upvoted comments

Still a problem.

Still an issue indeed

You have to actually play a sound to get it to work, not just set the Audio to play in silent mode. Set the audio as you did above, then go a step further and play something. I used a 0.1s silent sound file.