I am trying to make small program in python, using PyQt5. The program will as have two buttons, and a label in the middle. When the mouse goes over the label, I want to call a def, in order to change the button's color and play a sound from specific speaker (left or right)
I tried pygame, following some posts, but nothing. The sound is playing in both channels.
import time
import pygame
pygame.mixer.init(44100, -16,2,2048)
channel1 = pygame.mixer.Channel(0) # argument must be int
channel2 = pygame.mixer.Channel(1)
print('OkkK')
soundObj = pygame.mixer.Sound('Aloe Blacc - Wake Me Up.wav')
channel2.play(soundObj)
soundObj.set_volume(0.2)
time.sleep(6) # wait and let the sound play for 6 second
soundObj.stop()
Is there a way to fix this and choose the left-right speaker?
Also, is there a way to call a def, On Mouse Over a label?