Hello
I am trying to have a song play in the background of my app and then pause it whenever I need to. I am probably doing something wrong.
Simplified simulation of what I am trying to achieve:
from audioplayer import AudioPlayer
import threading
import time
a = AudioPlayer(r"D:\songs\bee.mp3")
def test():
a.play() # 'block=True' here doesn't help with the .pause or .resume issues.
b = threading.Thread(target=test) # Creating a thread
b.start() # This successfully starts the song
time.sleep(10)
print("pausing") # Prints out after 10s
a.pause() # Doesn't affect it at all
time.sleep(10)
print("resuming")# Prints out after another 10s and the program ends
a.resume() # The song just ends here, .resume once again has no effect.