aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRapptz <[email protected]>2017-04-19 17:33:16 -0400
committerRapptz <[email protected]>2017-04-19 17:33:16 -0400
commit34c60002bfa0d7f286c79cc4b9f4e90a44580948 (patch)
tree0e9bb250c9bb1909258f53ce83ab3301bb9232dc
parentAdd PCMVolumeTransformer to augment volume of a PCM stream. (diff)
downloaddiscord.py-34c60002bfa0d7f286c79cc4b9f4e90a44580948.tar.xz
discord.py-34c60002bfa0d7f286c79cc4b9f4e90a44580948.zip
Allow setting a default volume in PCMVolumeTransformer.
-rw-r--r--discord/player.py7
1 files changed, 5 insertions, 2 deletions
diff --git a/discord/player.py b/discord/player.py
index 96f52550..0e0ccd41 100644
--- a/discord/player.py
+++ b/discord/player.py
@@ -180,6 +180,9 @@ class PCMVolumeTransformer(AudioSource):
------------
original: :class:`AudioSource`
The original AudioSource to transform.
+ volume: float
+ The initial volume to set it to.
+ See :attr:`volume` for more info.
Raises
-------
@@ -189,7 +192,7 @@ class PCMVolumeTransformer(AudioSource):
The audio source is opus encoded.
"""
- def __init__(self, original):
+ def __init__(self, original, volume=1.0):
if not isinstance(original, AudioSource):
raise TypeError('expected AudioSource not {0.__class__.__name__}.'.format(original))
@@ -197,7 +200,7 @@ class PCMVolumeTransformer(AudioSource):
raise ClientException('AudioSource must not be Opus encoded.')
self.original = original
- self._volume = 1.0
+ self.volume = volume
@property
def volume(self):