player + vlc-player + popup-spam

This commit is contained in:
BarsTiger
2022-04-15 09:56:29 +03:00
parent 28f0151038
commit 33a0120efd
3 changed files with 72 additions and 1 deletions

16
modules/player.py Normal file
View File

@@ -0,0 +1,16 @@
import time
def playvlc(file_path, volume: int = 100, sleep: float = None):
import vlc
"""
Play a file with VLC
"""
player = vlc.MediaPlayer(file_path)
player.play()
player.audio_set_volume(volume)
time.sleep(0.5)
if sleep is not None:
time.sleep(sleep)
else:
time.sleep(player.get_length())