Skip to content

Add clarifications about ranges in mixer docs #2738

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 2 commits into from
May 26, 2024
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 5 additions & 4 deletions docs/reST/ref/mixer.rst
Original file line number Diff line number Diff line change
Expand Up @@ -431,7 +431,7 @@ The following file formats are supported
| :sl:`get the playback volume`
| :sg:`get_volume() -> value`

Return a value from 0.0 to 1.0 representing the volume for this Sound.
Return a value from 0.0 to 1.0 (inclusive) representing the volume for this Sound.

.. ## Sound.get_volume ##

Expand Down Expand Up @@ -472,7 +472,7 @@ The following file formats are supported
| :sg:`Channel(id) -> Channel`

Return a Channel object for one of the current channels. The id must be a
value from 0 to the value of ``pygame.mixer.get_num_channels()``.
value from 0 to the value of ``pygame.mixer.get_num_channels()`` (exclusive).

The Channel object can be used to get fine control over the playback of
Sounds. A channel can only playback a single Sound at time. Using channels
Expand Down Expand Up @@ -577,7 +577,7 @@ The following file formats are supported

Set the volume (loudness) of a playing sound. When a channel starts to
play its volume value is reset. This only affects the current sound. The
value argument is between 0.0 and 1.0.
value argument is in the range of 0.0 to 1.0 (inclusive).

If one argument is passed, it will be the volume of both speakers. If two
arguments are passed and the mixer is in stereo mode, the first argument
Expand All @@ -603,7 +603,8 @@ The following file formats are supported
| :sl:`get the volume of the playing channel`
| :sg:`get_volume() -> value`

Return the volume of the channel for the current playing sound. This does
Return the volume of the channel for the current playing sound
in the range of 0.0 to 1.0 (inclusive). This does
not take into account stereo separation used by
:meth:`Channel.set_volume`. The Sound object also has its own volume
which is mixed with the channel.
Expand Down