Open earlquadra8 opened 5 years ago
Hi! Could you post your code, please?
There is not a lower limit on the duration of a sound file.
const thisPlay = new Sound("http://image.mypays.cn/data/lsy/sound/aa_bb.mp3",null, e => { if (e) { console.log(e) return }; thisPlay.play(() => thisPlay.release()); });
{extra: -2147483648, what: 1}
React Native Sound:“^ 0.11.0” React Native:“0.59.9” Android Problem
@QShengW Could you post a new issue and fill out the full template, please?
@earlquadra8 I had this issue as well (loaded from the raw directory). Exact same error. After a very long investigation on this I found the issue is with Android not with this package. I used a mp3 validator and found out that if an mp3 doesn't have at least 5 mpeg frames it is invalid. iOS and macOS don't care, but Android does and won't load it. I had to switch my 1 second mp3's that had 1 - 2 mpeg frames out with wav versions and it works great.
same issue here.
let's say you have a multiple flip effect with a delay of 400ms between the flips. flip = new Sound('flip.wav', Sound.MAIN_BUNDLE);
flip.play(); setTimeout(() => { flip.play(); }, 400);
the sound will work just for the first play. but not for the one inside the timeout. but if the timeout is > 1000ms, it works fine.
ios and android are having the same behaviour in this case.
Here's how i achieve it using a pop sound effect
onPress={() => {
popSFX.stop();
popSFX.play();
}}
:beetle: Description
I want it to play a sfx, which shorter than a second, whenever I click a button. I wonder if the sound clip length have a lower limit.
:beetle: What have you tried?
When I try to use the play() with a .mp3 length longer than 1 sec, it works fine, but when I try to use a shorter .mp3 length shorter than 1 sec, the play() success callback return false.
Is your issue with...
Are you using...
react-native run-android
)Which versions are you using?
Does the problem occur on...
If your problem is happening on a device, which device?