-
Notifications
You must be signed in to change notification settings - Fork 1
/
music_player.py
62 lines (38 loc) · 997 Bytes
/
music_player.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
# -*- coding: utf-8 -*-
"""
Created on Sat Dec 19 04:33:38 2020
@author: girik
"""
import pygame
from playlist import *
from ask_song import *
queue=[]
pygame.mixer.init()
global paused
paused=False
def pause_music(is_paused):
global paused
paused= is_paused
if paused:
pygame.mixer.music.unpause()
paused=False
else:
pygame.mixer.music.pause()
paused=True
# def stop_music():
# pygame.mixer.music.stop()
# song_box.selection_clear(ACTIVE)
# status_bar.config(text='')
def volume(num):
pygame.mixer.music.set_volume(num)
def get_volume():
return pygame.mixer.music.get_volume()
def queue():
pygame.mixer.music.queue(User_Played_queue)
def next_song():
current_song=song_box.curselection()
next_one=current_song[0]+1
song=song_box.get(next_one)
song= f'Halsey_Music/{song}.mp3'
pygame.mixer.music.load(song)
pygame.mixer.music.play(loops=0)