1

With react-native-background-timer (2.4.1) and react-native-sound (0.11.1), I play a sound after countdown.

import Sound from 'react-native-sound'
...
Sound.setCategory('Playback')
const soundEnd = new Sound('training.mp3', Sound.MAIN_BUNDLE)

...

const playBackgroundTimer = useCallback(
  (timeInSeconds) => {
    const timeoutId = BackgroundTimer.setTimeout(() => {
      soundEnd.play(() => {})
    }, (1000 * timeInSeconds) - 5000)

    return timeoutId
  },
  []
)

The countdown countdown sound (just a five second beep) permanently mutes the user's music (Deezer, Spotify, etc.).

Ideally, I would like the user's music to drop in volume, and if not possible for it to continue after the countdown.

Do you have a solution ?

Gaylord.P
  • 1,539
  • 2
  • 24
  • 54

0 Answers0