def playsound(soundfile):
    """Play sound through default mixer channel in blocking manner.
    
    This will load the whole sound into memory before playback
    """

    sound = pygame.mixer.Sound(soundfile)
    clock = pygame.time.Clock()
    sound.play()
    while pygame.mixer.get_busy():
        clock.tick(FRAMERATE)
Play sound through default mixer channel in blocking manner.
    
    This will load the whole sound into memory before playback
    
recipes/Python/521884_Play_sound_files_pygame_crossplatform/recipe-521884.py