feat: add adjusted_length
This commit is contained in:
parent
6c7f06ec25
commit
cc571f17f2
|
|
@ -196,6 +196,14 @@ class Player(VoiceProtocol):
|
|||
"""Property which returns the player's position in a track in milliseconds adjusted for rate"""
|
||||
return self.position / self.rate
|
||||
|
||||
@property
|
||||
def adjusted_length(self) -> float:
|
||||
"""Property which returns the player's track length in milliseconds adjusted for rate"""
|
||||
if not self.is_playing:
|
||||
return 0
|
||||
|
||||
return self.current.length / self.rate
|
||||
|
||||
@property
|
||||
def is_playing(self) -> bool:
|
||||
"""Property which returns whether or not the player is actively playing a track."""
|
||||
|
|
|
|||
Loading…
Reference in New Issue