Skip to content
This repository has been archived by the owner on Dec 11, 2017. It is now read-only.

bug while changing volume on play #22

Open
GoogleCodeExporter opened this issue Mar 13, 2015 · 3 comments
Open

bug while changing volume on play #22

GoogleCodeExporter opened this issue Mar 13, 2015 · 3 comments

Comments

@GoogleCodeExporter
Copy link

Reproducing the problem:
1. start to play voice file.
2. change music volume.

I am expecting to hear volume changing real-time.
Instead of that, I need to stop playing file, the next, change volume and start 
playing again.

<code>
SoundController soundController = new SoundController();
Sound sound = soundController.createSound(Sound.MIME_TYPE_AUDIO_MPEG,
        "url/to/your/sound/file.mp3");
sound.setVolume(20);
sound.play(); //File has being loaded from server and is playing some music. 

//After some time I am changing volume.
sound.setVolume(100); //In that place volume are not going to change. It has 
the same value(20). If I press stop and play it will be 100.
</code>

Original issue reported on code.google.com by [email protected] on 7 Jul 2011 at 9:41

@GoogleCodeExporter
Copy link
Author

I was not precise while writing "press stop and play". Of course, I am saying 
about calling gwt-voices methods.

Original comment by [email protected] on 7 Jul 2011 at 9:54

@GoogleCodeExporter
Copy link
Author

This appears to depend on the implementation used. For example, Html5Sound 
updates on the fly:

    audio.getAudioElement().setVolume(volume / 100d);

as does FlashSound:

      voicesMovie.setVolume(soundNumber, volume);

and NativeSound:

    elem.setAttribute("volume", "" + volume);

However, WebAudioSound's setVolume() only modifies the internal state variable 
without updating the currently playing sound's gain node.

I am not sure if the API makes any guarantees as to behaviour, but it's 
troublesome that the different implementations are so different.

Original comment by [email protected] on 25 Mar 2014 at 3:07

@ThomasWrobel
Copy link

Just noticed this issue myself.
Is the recommendation these days just to use Html5 audio on everything?

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

No branches or pull requests

2 participants