Volume oscillating in React Native

86 Views Asked by At

I've created a metronome using react-native, nothing that fancy (pseudo version below)

import Sound from 'react-native-sound'
import tick from './tick.mp3'
sound = new Sound(tick, Sound.MAIN_BUNDLE)

play = function() { sound.play() }

setInterval(play, 1000)

The problem is that when I deploy to my phone, the volume oscillates (I guess). Most 'ticks' are fine, but some play really low.

I tried a few Sound.setCategory() without success.

Has anyone been in that situation before? I'm deploying to an Android device (didn't test and don't plan to on ios)

"react-native": "^0.63.2"

0

There are 0 best solutions below