Closed 1Ghasthunter1 closed 3 years ago
Solved the issue, just had to check your example. Proper way to do it:
sound_obj.volume = volume_value
, where volume_value
is from 0-100. I learned this from the example, but you might want to consider adding this in the docs so it's a little more clear. Thanks for publishing this lib though, very useful.
Hi,
volume is a property, not a method, so use obj.volume = value
I will improve the documentation with code snippets.
Python 3.9.0 Windows 10 Version 2004 OS Build 19041.572 Not sure if this is my fault or libs fault, but when running this code:
sound_obj.volume(current_volume)
wherecurrent_volume
is anint
between0
and100
, andsound_obj = AudioPlayer("sound/soundfile.mp3")
and is currently playing withblock=False
, andaudioplayer
is imported as:from audioplayer import AudioPlayer
A TypeError is raised,
TypeError: 'int' object is not callable
.I understand that the
sound_obj.volume
is anint
being returned from theAudioPlayer
class, but I looked at the code inside the library and I'm not the best with decorators and couldn't understand how the volume was supposed to be set.