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
Thanks so much for the React Native Sound package.
I have tested the package with remote files and required ones using require module. But my problem is playing a file that is not in the two categories above.
For example, I use react-native-document-picker which allows the user to select a file from the phone storage. I want to play that sound but I am not able.
Please what is the suggested way of dealing with sort like that?
letcallback=(error,sound)=>{if(error){console.log('failed to load the sound',error);return;}sound.play(()=>{sound.release();});}letsoundFile=this.props.urisoundFile=require("../assets/audio/advertising.mp3")//working finevarsound=newSound(soundFile,error=>callback(error,sound));soundFile="https://raw.githubusercontent.com/zmxv/react-native-sound-demo/master/frog.wav"//this working.varsound=newSound(soundFile,"",error=>callback(error,sound));soundFile=this.props.uri//not working. The uri is the location of the file selected by the user. Sample uri looks like "file://content://com.android.externalstorage.documents/document/300C-0FED%3AMusics%2FJWLibrary%2Fiacu_E_03.mp3"varsound=newSound(soundFile,"",error=>callback(error,sound));
Thank you for your prompt response
The text was updated successfully, but these errors were encountered:
Thanks so much for the React Native Sound package.
I have tested the package with remote files and required ones using require module. But my problem is playing a file that is not in the two categories above.
For example, I use react-native-document-picker which allows the user to select a file from the phone storage. I want to play that sound but I am not able.
Please what is the suggested way of dealing with sort like that?
Thank you for your prompt response
The text was updated successfully, but these errors were encountered: