Giter VIP home page Giter VIP logo

Comments (8)

mlop113 avatar mlop113 commented on June 16, 2024

same issue

from react-native-sound-player.

johnsonsu avatar johnsonsu commented on June 16, 2024

@mlop113 Hi, I just added this feature and published 0.6.2, please give it a try, thank you!

from react-native-sound-player.

mlop113 avatar mlop113 commented on June 16, 2024

thank you very much

from react-native-sound-player.

chrismang avatar chrismang commented on June 16, 2024

Hi, is working excellent with Android, but I couldn't make it work with iOS. I try different numbers (0.1, 0.5) and the volume is always maximum. What can I do?

from react-native-sound-player.

gurol avatar gurol commented on June 16, 2024

Yes, I have the same issue here in iOS. No change in sound level. It is always the maximum (version 0.6.2).

from react-native-sound-player.

johnsonsu avatar johnsonsu commented on June 16, 2024

Hi @chrismang, @gurol , how are you setting the volume? Can you try setting it inside the callback onFinishedLoading? You can try something like this for now:

  componentDidMount() {
    SoundPlayer.onFinishedLoading((success: boolean) => {
      console.log('finished loading', success)
      soundPlayer.setVolume(this.state.volume)
    })
  }
  
  setVolume(volume) {
    soundPlayer.setVolume(volume)
    this.setState({ volume })
  }

This is because on iOS the player might be deallocated in some cases. I will change the implementation of setVolume to resolve this issue ASAP.

from react-native-sound-player.

gurol avatar gurol commented on June 16, 2024

Hi @johnsonsu, I simply change the volume before playing the local mp3 file:

SoundPlayer.setVolume(0.25);
SoundPlayer.playSoundFile('example, 'mp3');

from react-native-sound-player.

johnsonsu avatar johnsonsu commented on June 16, 2024

@gurol , can you try changing it after? Because the current implementation will only instantiate the player when playing the sound. I will change the implementation in the next update.

from react-native-sound-player.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.