I have found many ways to interact with music in python, but in all there are only a few commands, start, stop, volume change, but I can't find a banal rewind.
The code at the moment:
import vlc
import time
import os
import random
def sound(sound):
vlc_instance = vlc.Instance()
player = vlc_instance.media_player_new()
media = vlc_instance.media_new(sound)
player.set_media(media)
player.play()
time.sleep(1.5)
duration = player.get_length() / 1000
time.sleep(duration)
path = r'C:\Hobby\Music'
files = os.listdir(path)
random.shuffle(files)
for i in files:
print(sound(os.path.join(path, i)))