You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
🪲 This particular error persisting in react native sound
🪲 react-native-sound unable to stream audio from an url
🪲 As usual i used the react-native-sound package with my react native application to play a remote music i had hosted from my node js server using express which was working absolutely fine in postman or any other browser i was using ngrok to make that global so that i can querry from the mobile device but the problem was that i was unable to do so.
🪲 Previously i used to use a local path to the audio file and it used to work just fine but this time i wanted to stream the audio from the internet from a server this is what i was trying to achieve
importReact,{useState}from'react';import{View,Text,Button,StyleSheet}from'react-native';importSoundfrom'react-native-sound';constAudioPlayerCard=()=>{const[sound,setSound]=useState(null);const[isPlaying,setIsPlaying]=useState(false);constaudioUrl='https://marshmello-bubbles.ngrok-free.app/assets/quran.wav';constloadSound=()=>{constnewSound=newSound(audioUrl,Sound.MAIN_BUNDLE,(error)=>{if(error){console.log('Failed to load the sound',error);return;}setSound(newSound);playSound();});};constplaySound=()=>{if(sound){sound.play((success)=>{if(success){console.log('Successfully finished playing');}else{console.log('Playback failed due to audio decoding errors');}setIsPlaying(false);});setIsPlaying(true);}else{loadSound();}};constpauseSound=()=>{if(sound&&isPlaying){sound.pause();setIsPlaying(false);}};conststopSound=()=>{if(sound){sound.stop(()=>{setIsPlaying(false);});}};return(<Viewstyle={styles.card}><Textstyle={styles.title}>AudioPlayer</Text><Viewstyle={styles.buttonContainer}><Buttontitle="Play"onPress={playSound}/><Buttontitle="Pause"onPress={pauseSound}disabled={!isPlaying}/>
<Buttontitle="Stop"onPress={stopSound}/></View></View>);};conststyles=StyleSheet.create({card: {padding: 20,margin: 10,backgroundColor: '#fff',borderRadius: 10,elevation: 3,shadowColor: '#000',shadowOffset: {width: 0,height: 2},shadowOpacity: 0.1,shadowRadius: 4,},title: {fontSize: 18,marginBottom: 10,fontWeight: 'bold',},buttonContainer: {flexDirection: 'row',justifyContent: 'space-between',},});exportdefaultAudioPlayerCard;
💡 Does the problem have a test case?
LOG Failed to load the sound {"extra": -2147483648, "what": 1}
LOG Failed to load the sound {"extra": -2147483648, "what": 1}
LOG Failed to load the sound {"extra": -2147483648, "what": 1}
LOG Failed to load the sound {"extra": -2147483648, "what": 1}
LOG Failed to load the sound {"extra": -2147483648, "what": 1}
LOG Failed to load the sound {"extra": -2147483648, "what": 1}
LOG Failed to load the sound {"extra": -2147483648, "what": 1}
💡 Possible solution
💡 Is there a workaround?
💡 If the bug is confirmed, would you be willing to create a pull request?
Is your issue with...
iOS
Android
Windows
Are you using...
React Native CLI (e.g. react-native run-android)
Expo
Other: (please specify)
Which versions are you using?
React Native Sound: "^0.11.2"
React Native: "0.74.5"
iOS: NA
Android: 11
Windows: NA
Linux(Ubuntu): Ubuntu 24.04 LTS x86_64
Does the problem occur on...
Simulator
Device
If your problem is happening on a device, which device?
Device: SMA50
The text was updated successfully, but these errors were encountered:
It seems you want to play a static file from the internet and this should be fine with this library. wav. is not an actual streaming format :) Can you update here where you are with the issue?
🪲 This particular error persisting in react native sound
🪲 react-native-sound unable to stream audio from an url
🪲 As usual i used the react-native-sound package with my react native application to play a remote music i had hosted from my node js server using express which was working absolutely fine in postman or any other browser i was using ngrok to make that global so that i can querry from the mobile device but the problem was that i was unable to do so.
🪲 Previously i used to use a local path to the audio file and it used to work just fine but this time i wanted to stream the audio from the internet from a server this is what i was trying to achieve
💡 Does the problem have a test case?
💡 Possible solution
💡 Is there a workaround?
💡 If the bug is confirmed, would you be willing to create a pull request?
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?
The text was updated successfully, but these errors were encountered: