Usually with audio you would access volume with: sound.volume = 10 However with Pydub, the volume is accessed using: sound + 10 The problem with this as I cannot exactly 'set' the volume, just adjust the volume that the song is currently at. I would like to create a Tkinter slider that I can vary between not hearable and loud. This is what I have so far:
root = tk.Tk()
root.geometry("500x500")
song1 = AudioSegment.from_file("./song.mp3")
def current_value(event):
song1 + slider.get()
#song1.volume = event
print(event)
slider = ttk.Scale(root, from_=-50, to=50, orient="horizontal",command=current_value)
slider.place(rely=.5, relx=.5)
def play_music(song):
play(song)
thread1 = threading.Thread(target=play_music, args=(song1,))
thread1.start()
root.mainloop()
#This mostly just lags the audio file