+ 5

Forwarding music using scale

def play(): data = audio_metadata.load("god. mp3") timelength = data["showinfo"]["duration"] scale. configure( from_=0,to=timelength) mixer. music.load("god. mp3) mixer. music.play() t1 = Thread(target=curr,args=(timelength, ) t1.start() def curr(t): x=0 while x<=t: scale.set(x) mins, secs=divmod(x,60) Des["text"]="{:2d}:{:2d}" time.sleep(1) x +=1 def forward(r): x=float(scale.get()) mixer. music.set_pos(x/60) scale.set(x) scale = Scale(root) scale. bind("<B1-Motion",forward) scale. pack() button = Button(root,text="play",command=Play) button.pack() Tell me why my code is not functioning well sometimes the song ends while i am still moving scale

15th Aug 2020, 6:46 PM
boolean
boolean - avatar
2 odpowiedzi
+ 3
I know how to play sound in python here I am trying to forward the audio using tkiner scale widget
17th Aug 2020, 11:20 AM
boolean
boolean - avatar
17th Aug 2020, 7:55 AM
Aditya Srivastava
Aditya Srivastava - avatar