Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #Запустить музызку из каталога
- elif cmd == 'cmusic':
- def createPlaylist():
- folder = ("C://Users//Black//Downloads//1")
- playlist = glob.glob(folder + "/*.mp3")
- if len(playlist) == 0:
- print("No recognisable MP3 files in ", folder)
- return playlist
- Instance = vlc.Instance('--input-repeat=999999', '--no-video-title-show', '--mouse-hide-timeout=5000')
- a = 0
- playlist = createPlaylist()
- while True:
- if a == len(playlist):
- a = 0
- playlist = createPlaylist()
- print("Media folder contains ", len(playlist), "MP3 files\n")
- player = Instance.media_player_new()
- player.set_fullscreen(True)
- MusicVideo = Instance.media_new(playlist[a])
- player.set_media(MusicVideo)
- player.play()
- time.sleep(1.5)
- duration = player.get_length() / 1000
- dwell = duration - 1.5
- time.sleep(dwell)
- player.stop()
- a += 1
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement