Crossplatform sound with Python standard library
Question: I have searched plenty to find an answer, I have seen winsound repeatedly but
that is just for windows and other modules seem to all be outside of the
standard library.

Is there a simple way to play a `.wav` or any sound file using something from
the standard library that will work on most platforms?


Answer: You can find all the information here: <https://wiki.python.org/moin/Audio/>

You can see that there are some built in modules like `wave` and others which
are probably way better and are also platform independent.

If you choose to go with external libraries, you can plenty options like
`PyMedia`, `PySDL`, `wxPython` and many others.

For example, using `PyMedia`:

    
    
    import pymedia.audio.sound as sound
    f = wave.open('myFile.wav', 'rb')
    snd = sound.Output( f.getframerate(), f.getnchannels(), sound.AFMT_S16_LE )
    s = f.readframes( 300000 )
    snd.play(s)
    

