My code:
import pygame
import time
pygame.mixer.init() #to initiate the mixer
pygame.mixer.music.load('/home/xolo/bahara.mp3') #load path of song
time.sleep(1)
pygame.mixer.music.stop() #stop loaded song
while pygame.mixer.music.get_busy():
time.sleep(1)
Is there any way to handle 2 programs for playing and stopping music using pygame.
Using a similar script I am able to play music but using above code I am not able to stop the music when executing from the terminal.