def playmusic(soundfile):
    """Stream music with mixer.music module in blocking manner.
    
    This will stream the sound from disk while playing.
    """

    clock = pygame.time.Clock()
    pygame.mixer.music.load(soundfile)
    pygame.mixer.music.play()
    while pygame.mixer.music.get_busy():
        clock.tick(FRAMERATE)
Stream music with mixer.music module in blocking manner.
    
    This will stream the sound from disk while playing.
    
recipes/Python/521884_Play_sound_files_pygame_crossplatform/recipe-521884.py