Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Can't play any track.. #7

Closed
losheredos opened this issue Jul 9, 2018 · 3 comments
Closed

Can't play any track.. #7

losheredos opened this issue Jul 9, 2018 · 3 comments

Comments

@losheredos
Copy link

losheredos commented Jul 9, 2018

My codes :
import SoundPlayer from 'react-native-sound-player';

playTrack(){
try {
SoundPlayer.playSoundFile('free', 'mp3');
} catch (e) {
console.log(cannot play the sound file, e);
}
}

When I call this function I get error in console log;

"cannot play the sound file TypeError: Cannot read property 'playSoundFile' of undefined"

What I should do ?.. I checked all options again and again, I linked correctly, mp3 files are located in raw.. I dont know what else I can do .

Edit: I run react-native run-android to compile the project again now its not giving error but I dont hear any sounds..

@losheredos
Copy link
Author

losheredos commented Jul 9, 2018

OK guys I solved it so it was about my android simulator had no sound itself.. If you will have a similar problem like me you can check first your android simulator's sound.. It works easily and nicely! Thank you again for this :))

@johnsonsu
Copy link
Owner

Glad you fix it! Thanks for the update and info. They will be helpful for others!

@sulemantech
Copy link

@losheredos would you mind sharing the steps you have followed to solve this issue. I am using expo and getting the same error. I don't know how to get rid of it. Thank you.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants