You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
When setting a global volume for the SoundManager it would previously incorrectly calculate the volumes of AudioTag based Sound objects that were not played at volume 1. The new approach uses Sound.updateGlobalVolume which adjusts the Sound volume to be a percentage of the global volume. So if the global volume is 0.5 and the Sound volume is 0.5, the Sound will play with an actual volume of 0.25 (thanks @VitaZheltyakovphaserjs#2325)
Copy file name to clipboardExpand all lines: README.md
+2Lines changed: 2 additions & 0 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -347,6 +347,7 @@ You can read all about the philosophy behind Lazer [here](http://phaser.io/news/
347
347
* Camera.follow now uses the Targets `world` property to seed the camera coordinates from, rather than its local position. This means Sprites that are members of offset Groups, or transformed display lists, should now be followed more accurately (thanks @rbozan#2106)
348
348
* PluginManager.destroy is now called by Game.destroy.
349
349
* Game.forceSingleUpdate is now `true` by default.
350
+
* Video now uses MediaStreamTrack.stop() instead of MediaStream.stop() where possible, as the later is now deprecated in some browsers (thanks @stoneman1#2371)
350
351
351
352
### Bug Fixes
352
353
@@ -364,6 +365,7 @@ You can read all about the philosophy behind Lazer [here](http://phaser.io/news/
364
365
* Arcade.Body's speed property was only set when the body moved, it now updates regardless (thanks @mark-henry#2417)
365
366
* Camera.position would return the view rectangles centerX/Y coordinates, instead of view.x/y (which is what Camera.x/y returns), so it has been updated to return view.x/y instead (thanks @kamparR#2120)
366
367
* Passing a BitmapData to a TileSprite as a texture would fail if the BitmapData had not been previously added to the cache. It now uses the new frameData property (thanks @mzamateo@lucap86#2380)
368
+
* When setting a global volume for the SoundManager it would previously incorrectly calculate the volumes of AudioTag based Sound objects that were not played at volume 1. The new approach uses Sound.updateGlobalVolume which adjusts the Sound volume to be a percentage of the global volume. So if the global volume is 0.5 and the Sound volume is 0.5, the Sound will play with an actual volume of 0.25 (thanks @VitaZheltyakov#2325)
Copy file name to clipboardExpand all lines: src/sound/Sound.js
+53-31Lines changed: 53 additions & 31 deletions
Original file line number
Diff line number
Diff line change
@@ -901,17 +901,17 @@ Phaser.Sound.prototype = {
901
901
},
902
902
903
903
/**
904
-
* Starts this sound playing (or restarts it if already doing so) and sets the volume to zero.
905
-
* Then increases the volume from 0 to 1 over the duration specified.
906
-
*
907
-
* At the end of the fade Sound.onFadeComplete is dispatched with this Sound object as the first parameter,
908
-
* and the final volume (1) as the second parameter.
909
-
*
910
-
* @method Phaser.Sound#fadeIn
911
-
* @param {number} [duration=1000] - The time in milliseconds over which the Sound should fade in.
912
-
* @param {boolean} [loop=false] - Should the Sound be set to loop? Note that this doesn't cause the fade to repeat.
913
-
* @param {string} [marker=(current marker)] - The marker to start at; defaults to the current (last played) marker. To start playing from the beginning specify specify a marker of `''`.
914
-
*/
904
+
* Starts this sound playing (or restarts it if already doing so) and sets the volume to zero.
905
+
* Then increases the volume from 0 to 1 over the duration specified.
906
+
*
907
+
* At the end of the fade Sound.onFadeComplete is dispatched with this Sound object as the first parameter,
908
+
* and the final volume (1) as the second parameter.
909
+
*
910
+
* @method Phaser.Sound#fadeIn
911
+
* @param {number} [duration=1000] - The time in milliseconds over which the Sound should fade in.
912
+
* @param {boolean} [loop=false] - Should the Sound be set to loop? Note that this doesn't cause the fade to repeat.
913
+
* @param {string} [marker=(current marker)] - The marker to start at; defaults to the current (last played) marker. To start playing from the beginning specify specify a marker of `''`.
914
+
*/
915
915
fadeIn: function(duration,loop,marker){
916
916
917
917
if(loop===undefined){loop=false;}
@@ -929,28 +929,28 @@ Phaser.Sound.prototype = {
929
929
},
930
930
931
931
/**
932
-
* Decreases the volume of this Sound from its current value to 0 over the duration specified.
933
-
* At the end of the fade Sound.onFadeComplete is dispatched with this Sound object as the first parameter,
934
-
* and the final volume (0) as the second parameter.
935
-
*
936
-
* @method Phaser.Sound#fadeOut
937
-
* @param {number} [duration=1000] - The time in milliseconds over which the Sound should fade out.
938
-
*/
932
+
* Decreases the volume of this Sound from its current value to 0 over the duration specified.
933
+
* At the end of the fade Sound.onFadeComplete is dispatched with this Sound object as the first parameter,
934
+
* and the final volume (0) as the second parameter.
935
+
*
936
+
* @method Phaser.Sound#fadeOut
937
+
* @param {number} [duration=1000] - The time in milliseconds over which the Sound should fade out.
938
+
*/
939
939
fadeOut: function(duration){
940
940
941
941
this.fadeTo(duration,0);
942
942
943
943
},
944
944
945
945
/**
946
-
* Fades the volume of this Sound from its current value to the given volume over the duration specified.
947
-
* At the end of the fade Sound.onFadeComplete is dispatched with this Sound object as the first parameter,
948
-
* and the final volume (volume) as the second parameter.
949
-
*
950
-
* @method Phaser.Sound#fadeTo
951
-
* @param {number} [duration=1000] - The time in milliseconds during which the Sound should fade out.
952
-
* @param {number} [volume] - The volume which the Sound should fade to. This is a value between 0 and 1.
953
-
*/
946
+
* Fades the volume of this Sound from its current value to the given volume over the duration specified.
947
+
* At the end of the fade Sound.onFadeComplete is dispatched with this Sound object as the first parameter,
948
+
* and the final volume (volume) as the second parameter.
949
+
*
950
+
* @method Phaser.Sound#fadeTo
951
+
* @param {number} [duration=1000] - The time in milliseconds during which the Sound should fade out.
952
+
* @param {number} [volume] - The volume which the Sound should fade to. This is a value between 0 and 1.
0 commit comments