zmxv / react-native-sound

React Native module for playing sound clips
MIT License
2.78k stars 748 forks source link

`setVolume` docs wrong for android #767

Open punndcoder28 opened 2 years ago

punndcoder28 commented 2 years ago

:beetle: Description

The setVolume() method doc says the value ranges from 0 to 1 but on android it is ranging from 0 to 0.1 as described here :beetle: What is the observed behavior?

Changing volume works perfectly when it ranges from 0 to 0.1

:beetle: What is the expected behavior?

Docs should be updated for the correct values on android

:beetle: Please post your code:

playButtonMusic = () => {
    const buttonAudio = new Sound(require('../../assets/audioFiles/clickSound.mp3'), () => {
      buttonAudio.setVolume(0.05); // now it is at 50%
      buttonAudio.play(() => {
        buttonAudio.release();
      });
    });
  };

:bulb: Does the problem have a test case?

Running on android device should be a valid test case

:bulb: Possible solution

Updating the docs of the library

:bulb: If the bug is confirmed, would you be willing to create a pull request?

Yes

Is your issue with...

Are you using...

Which versions are you using?

Does the problem occur on...

If your problem is happening on a device, which device?