Sound effects interrupt music / background audio on iOS
Describe the bug When game event sounds are enabled they constantly pause any background audio that may be playing (e.g. music, podcasts, PiP videos). This is incredibly annoying!
To Reproduce Steps to reproduce the behavior:
- Go to 'Settings'
- Click on 'Sound | Notifications'
- Switch on 'Toggle Sound'
- Play background audio
- Play a game.
- Each move will pause audio.
Expected behavior Sound effects not interfering with background audio.
Smartphone
- Device: iPhone XS and 13 Pro
- OS: iOS 14, iOS 15
IIRC I switched to AVAudioPlayer to play sound effects because people were complaining they couldn't adjust the volume. But I agree this isn't the right way to play audio effects and this issue is annoying, so I'll try to fix it.
Can't reproduce on my ipad 15.1. The audio player is already configured to play ambiant sounds, which can mix with other audio apps: https://github.com/veloce/capacitor-sound-effect/blob/main/ios/Plugin/SoundEffectPlugin.swift#L17
See: https://developer.apple.com/design/human-interface-guidelines/ios/user-interaction/audio/
Here’s a screen recording showing the problem: https://youtube.com/shorts/2niQxUgrqok?feature=share
This is on iOS 15.0.2 on an iPhone 13 Pro.
Also cannot repro:
- iPad, iOS 14.8.1, Lichess v7.13.1
- iPhone 13 Pro (simulator), iOS 15.0, Lichess v7.14.0
I had this issue on
Device: iPhone 11 Pro
OS: ios 15.0.2
Version 7.13.1
but not anymore on ios 15.1
@ulope perhaps you should try to upgrade to ios 15.1 to see if it solves your issue?
Yeah will do that and report back. It's still weird though. I don't have this issue with any other app that plays sound effects (games, productivity apps, etc.).
Ok, with 15.1.1 the problem appears to be fixed :)
Hm I think I spoke too soon.
At least with Netflix in PIP mode the problem still happens. Haven't tested with other apps yet.
It happens on Android 8.1. I have tested with the same version and the same music file. On Android 12, the background music is not interrupted, but on Android 8.1, the music is briefly interrupted when the sound effect is played. At first, I wondered if this is because the device (8.1) is too weak in terms of processing power, but when I used the mobile web version on FireFox Android, the same sound effect could be played without interrupting the background music, so I suspect that it is probably some sort of incorrect coding for playing sound effect in Android 8.1.
I came here to file the same issue. This is SUPER annoying and it's 100% reproducible for me. iOS 15.4 on an iPhone 11, with Lichess 7.15.1
Merely opening Lichess is enough to hijack the audio. I'm using Bluetooth headphones and my phone is on silent mode--Lichess still produces sound effects in silent mode if headphones are active.
The headphones may be the key to reproducing the issue; it may not manifest otherwise.
lichess moves don't interrupt music but starting the app does for me lmao
https://user-images.githubusercontent.com/30770221/215559043-afa5d0be-fb45-44f9-9624-4a0d60719c11.MP4
see opening the app causes an interrupt