JonnyNich
JonnyNich

Reputation: 1281

Python Winsound equivalent for Mac

I was wondering if there was a winsound equivalent for playing .wav files on Mac? Preferably a native import. Thanks

Upvotes: 5

Views: 13379

Answers (1)

Will
Will

Reputation: 5480

A native import will cause trouble here, as other modules have said functionality.

I assume you know how to install modules, so I won't go over that.

Here is an option:

  1. Pygame (sudo pip install pygame)

    import pygame
    pygame.init()
    pygame.mixer.init()
    sounda= pygame.mixer.Sound("desert_rustle.wav")
    sounda.play()
    

Upvotes: 4

Related Questions