-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathMusicMindCode.py
144 lines (92 loc) · 3.7 KB
/
MusicMindCode.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
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
import mindwave, time
import pygame
from pygame import mixer
from tkinter import *
from pydub import AudioSegment
from pydub.playback import play
import os
n=10
headset = mindwave.Headset('/dev/rfcomm0')
time.sleep(2)
# developed by anmol.code
while True:
time.sleep(.5)
x=int(headset.attention)
print(x)
for i in range(n):
if x>=0 and x<=25:
while True:
root = Tk()
root.title(' Music Mind')
root.geometry("500x400")
pygame.mixer.init()
def playsong():
pygame.mixer.music.load("madirfan-both-of-us-14037.mp3")
pygame.mixer.music.play()
mixer.music.set_volume(1)
title=Label(root,text="Music Mind",bd=9,relief=GROOVE,
font=("times new roman",50,"bold"),bg="white",fg="green")
title.pack(side=TOP,fill=X)
x=playsong()
root.after(10000, lambda: root.destroy())
time.sleep(2)
root.mainloop()
break
break
if x>=26 and x<=50:
while True:
root = Tk()
root.title('Music Mind')
root.geometry("500x400")
pygame.mixer.init()
def playsong():
pygame.mixer.music.load("madirfan-both-of-us-14037.mp3")
pygame.mixer.music.play()
mixer.music.set_volume(.75)
title=Label(root,text="Music Mind",bd=9,relief=GROOVE,
font=("times new roman",50,"bold"),bg="white",fg="green")
title.pack(side=TOP,fill=X)
x=playsong()
root.after(10000, lambda: root.destroy())
time.sleep(2)
root.mainloop()
break
break
if x>=51 and x<=75:
while True:
root = Tk()
root.title('Music Mind')
root.geometry("500x400")
pygame.mixer.init()
def playsong():
pygame.mixer.music.load("madirfan-both-of-us-14037.mp3")
pygame.mixer.music.play()
mixer.music.set_volume(.50)
title=Label(root,text="Music Mind",bd=9,relief=GROOVE,
font=("times new roman",50,"bold"),bg="white",fg="green")
title.pack(side=TOP,fill=X)
x=playsong()
root.after(10000, lambda: root.destroy())
time.sleep(2)
root.mainloop()
break
break
if x>=76 and x<=100:
while True:
root = Tk()
root.title('Music Mind')
root.geometry("500x400")
pygame.mixer.init()
def playsong():
pygame.mixer.music.load("madirfan-both-of-us-14037.mp3")
pygame.mixer.music.play()
mixer.music.set_volume(.25)
title=Label(root,text="Music Mind",bd=9,relief=GROOVE,
font=("times new roman",50,"bold"),bg="white",fg="green")
title.pack(side=TOP,fill=X)
x=playsong()
root.after(10000, lambda: root.destroy())
time.sleep(2)
root.mainloop()
break
break