title: How to play raw mp3 data in python
body: <p>I'm writing an interface that can play music, manipulate playlist, etc using gmusicapi ( <a href="https://github.com/simon-weber/Unofficial-Google-Music-API" rel="nofollow">https://github.com/simon-weber/Unofficial-Google-Music-API</a> ). I've got my application so that it can download the raw mp3 data, but am having a hard time finding a library that will play it. GST can play urls, but doesn't allow cookie auth. pygame can play mp3's, but from file, not data. Does anybody know how do play raw mp3 data in python?</p>
  
  <pre><code>def gm_PlaySong(self, url):
      req = urllib2.Request(url)
      for cookie in self.api.session.cookies:
          req.add_header(cookie.name, cookie.value)
      resp = urllib2.urlopen(req)
      song = resp.read()
  </code></pre>
  
  <p>song being the raw mp3.</p>