title: playing sound from buffer using pygame
body: <p>I'm trying to play a sound from a buffer in pygame. The following code correctly plays the sound once, but then results in <code>TypeError: must be string without null bytes, not str</code>.</p>
  
  <pre><code>f = open('sound.wav', 'rb')
  data = f.read()
  buffer = data[44:len(data)] # start after header
  pygame.mixer.Sound(buffer).play()
  </code></pre>
  
  <p>Because the error occurs after the sound has correctly played once, my suspicion is that <code>play()</code> expects <code>buffer</code> to be longer.</p>