I'm trying to use Pygame library in Python to play some piano sounds. I have the notes in .wav format, and I want to play some notes consistently, using a while loop, but the result isn't as I except.
I really tried some other possible solution, but I didn't found any that solve my problem. I want these three notes (sounds) to be played simultaneously and to be repeated every 0.4 seconds.
c4.wav : https://gofile.io/?c=F3U1LG
e4.wav : https://gofile.io/?c=4KflZ9
a4.wav : https://gofile.io/?c=mtNXWd
import pygame
import time
pygame.init()
c4 = pygame.mixer.Sound("c4.wav")
e4 = pygame.mixer.Sound("e4.wav")
a4 = pygame.mixer.Sound("a4.wav")
while True:
c4.play()
e4.play()
a4.play()
time.sleep(0.4)