question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

No sound on Android APK

See original GitHub issue

Hi guys! I’ve found a problem and I don’t know how to solve It. Right now I’m playing an audio from a ‘require’ like this:

{...}
const requireAudio = require('../../assets/audio/audio_sample.mp3');
{...}
Sound.setCategory('Ambient', true);

    this.sound = null;

    this.playSoundFromRequire = () => {
      const sound = new Sound(requireAudio, (error) => {
        if (error) {
          console.log('error', error);
          return;
        }
        if (this.state.opened) {
          sound.play(() => sound.release());
        }   
      });
{...}

If I use the app with the React packager the sound is playing fine, but once I deploy the app as an APK the sound Is missing. I haven’t tested It yet on iOS, but on Android I have this issue, any ideas?

Issue Analytics

  • State:open
  • Created 6 years ago
  • Reactions:2
  • Comments:10 (1 by maintainers)

github_iconTop GitHub Comments

4reactions
mklbcommented, Oct 5, 2018

so for me it was a path issue:

    if (Platform.OS === 'ios'){
      // I have/had a folder for all my files for the iOS app but this does not work for android
      this.path = "sounds/"
    }else{
      // android: drop files in ./android/app/src/main/res/raw
      // all files must be lower case and with underscores "_"
      this.path = ""
    }

   new Sound(this.path + YOUR_FILE_NAME, Sound.MAIN_BUNDLE)
1reaction
facuacostagcommented, Aug 23, 2017

Hey @zk2401 , so in the end my project had to use online data and it’s working fine, I wasn’t able to find a solution for local data.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Mobile download on Android has no sound? : r/NuCarnival
Maybe go to Settings > Sounds and Vibration > Sound Quality and Effects > turn on Dolby Atmos. Hope that works.
Read more >
NO Sound Button APK for Android Download - APKPure
Amaze your friends with this original sound effect! Download NO Sound Button and play the sound by pressing the button. Extras: 1.3D Animations...
Read more >
How to Fix 'No sound on Android video' Error
Sometimes you face no sound when playing videos on their Android phones. This blog will provide you complete solution for this problem.
Read more >
Fix No Sound on Videos When Playing on An Android Phone!
Part 2: Methods to Fix No Sound on Videos on Android · 01 Re-Check Basic Settings · 02 Factory Reset Your Device ·...
Read more >
8 Ways to Fix Video Sound Not Working on Android
Part 2: How to Fix Video No Sound Problem on Android? · Fix 1: The Volume Settings · Fix 2: Restarting the Device...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found