Closed omerkok closed 2 years ago
packageAudio.getDuration(), packageAudio.isPlaying() functions such as work only have a problem with play .
@omerkok Did you solve the issue? I started getting these errors recently, although everything was fine before.
The same of me. Added. Made pod install
and added file, but it crashes with error described above
Ah, ok. Typescript declaration is wrong.
It says that onEnd
function is unnecessary: play(onEnd?: (success: boolean) => void): this
But for iOS you actually should define it: yourSound.play(() => {});
Yeah, already figured that out, too. Thank you!
:beetle: Description
I am trying to play sound in ios simulator, but I am getting an error as RNSound must not be null. I will ask you to help, there are no problems for android only ios.
:beetle: What have you tried?
301 / 5000
-I did it with automatic linking at first, then I did the manual linking for ios. -I deleted my project folder in -x code->Derivered Data and rebuilt the project. -npm start -- --reset-cache -watchman watch-del-all -delete and rebuild the app but none produced results.
:beetle: Please post your code:
import Sound from 'react-native-sound';
const packageAudio = new Sound('audio1.mp3', Sound.MAIN_BUNDLE, (error) => { if (error) { console.log('failed to load the sound', error); return; } });
:bulb: Possible solution
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?