import os
import sys
import pygame
from pygame import mixer
pygame.mixer.init()
def snd(nume):
numeintreg = os.path.join("sunete",nume)
sound = pygame.mixer.Sound(numeintreg)
return sound
This is "main.py".
The sounds "o.wav" can be any sound file.
import os
import sys
import pygame
from pygame import *
import load
def main():
ocean=load.snd("o.wav")
ocean.play()
main()