I have a pygame project where I need to play sound. However when I tried to download some free sound effects, It did not play at the game. More correctly, It did play however the played sound was short(around 0.2 - 0.3s) and corrupted like a scratch noice. The sounds I used was also short, like 1 second sound so I suspected maybe I needed a longer sound(which would delay the sound's time however I wanted to be sure). I recorded a sound myself. 5-6 seconds, and the result was the same. The sound I recorded didnt play properly and instead produced a short scratch sound. I want to know the reason of this behavior.
Here is some of my code.
pygame.init()
pygame.mixer.init()
self.piece_pick_up = pygame.mixer.Sound(r"sound\piece_pick_up.mp3")
self.piece_drop = pygame.mixer.Sound(r"sound\piece_drop.mp3")
self.piece_pick_up.play()
This is not the whole code of course, I copied the relevant parts that I used for sound playing. The playing command is in the mouse handler when activates with click.
Am I doing something wrong ? But if the code was wrong, It should not have played at all, rather than playing corrupted sound.
I tried recording with 44100 and 22050 frequency, didn't fix the problem. please help me.
Note: I used mp3 file type.(I first tried Wav) Here is the first sound I tried if it is any help. It requires membership however for downloading.
https://www.freesound.org/people/newagesoup/sounds/339363/
Note 2: I used the following settings for the recording. Don't know if they are compatible with pygame.
Type: Mp3
Sample Rate: 22050 and 44100 (both tried)
Resample mode (if needed): 192pt Sinc
Bitrate: 128 kbps