@@ -438,6 +438,25 @@ The following file formats are supported
438438 | If value < 0.0, the volume will not be changed
439439 | If value > 1.0, the volume will be set to 1.0
440440
441+ .. note ::
442+ The values are internally converted and kept as integer values in range [0, 128], which means
443+ that ``get_volume() `` may return a different volume than it was set to. For example,
444+
445+ >>> sound.set_volume(0.1 )
446+ >>> sound.get_volume()
447+ 0.09375
448+
449+ This is because when you ``set_volume(0.1) ``, the volume is internally calculated like so
450+
451+ >>> int (0.1 * 128 )
452+ 12
453+
454+ This means that some of the precision is lost, so when you retrieve it again using ``get_volume() ``,
455+ it is converted back to a ``float `` using that integer
456+
457+ >>> 12 / 128
458+ 0.09375
459+
441460 .. ## Sound.set_volume ##
442461
443462 .. method :: get_volume
@@ -447,6 +466,9 @@ The following file formats are supported
447466
448467 Return a value from 0.0 to 1.0 (inclusive) representing the volume for this Sound.
449468
469+ .. note ::
470+ See :func: `Sound.set_volume ` for more information regarding the returned value
471+
450472 .. ## Sound.get_volume ##
451473
452474 .. method :: get_num_channels
@@ -627,6 +649,9 @@ The following file formats are supported
627649 sound.set_volume(0.6) # Now plays at 60% (previous value replaced).
628650 channel.set_volume(0.5) # Now plays at 30% (0.6 * 0.5).
629651
652+ .. note ::
653+ See :func: `Sound.set_volume ` for more information regarding how the value is stored internally
654+
630655 .. ## Channel.set_volume ##
631656
632657 .. method :: get_volume
@@ -640,6 +665,9 @@ The following file formats are supported
640665 :meth: `Channel.set_volume `. The Sound object also has its own volume
641666 which is mixed with the channel.
642667
668+ .. note ::
669+ See :func: `Sound.set_volume ` for more information regarding the returned value
670+
643671 .. ## Channel.get_volume ##
644672
645673 .. method :: get_busy
0 commit comments