0

Has anyone managed to override the silent mode switch to autoplay sounds using Expo AV? I'm looking to do so for a timer feature that I have in my app so I wouldn't be able to rely on user interaction to play the sound.

I have tried playsInSilentModeIOS: true, with no luck.

Ara
  • 1

1 Answers1

0

In your App.tsx/App.js, above function declaration, write this

if (Platform.OS === "ios")
  Audio.setAudioModeAsync({ playsInSilentModeIOS: true });
Kartikey
  • 4,516
  • 4
  • 15
  • 40
  • I already had this (kinda) in my configureaudio, wouldn't the below be the same? async function configureAudio() { try { const audioSettings = { shouldDuckAndroid: true, interruptionModeAndroid: Audio.INTERRUPTION_MODE_ANDROID_DO_NOT_MIX, }; if (Platform.OS === 'ios') { audioSettings.interruptionModeIOS = Audio.INTERRUPTION_MODE_IOS_DO_NOT_MIX; audioSettings.playsInSilentModeIOS = true; } await Audio.setAudioModeAsync(audioSettings); } } – Ara May 18 '23 at 16:14