title: What is this syntax error referring to in this avr sound code to convert a audio raw file to a .h file for the Arduino IDE
body: <p>I am attempting to convert an audio file to .h that an Arudino can read and I can use to play sound through a speaker without having to use an sd card module. So, I was following <a href="http://www.webondevices.com/arduino-tone-mp3-sound-with-no-shield" rel="nofollow noreferrer">this</a> tutorial to use this <a href="https://github.com/muayyad-alsadi/avr_sound" rel="nofollow noreferrer">avr sound</a> program from Github to convert the audio. It instructed me to use this python program to convert it however command prompt gives me an error telling me there's a syntax error in line 23 where the second quotation mark is. Any idea what I did wrong or how I can fix it?</p>
  
  <pre><code>#! /usr/bin/python
  
  import sys, os, os.path
  from avr_snd import *
  
  SEGMENT_MAX = 256
  SEGMENT_TMP = """
  #define %s%d_len %d
  const unsigned char %s%d[] PROGMEM=%s;
  
  """
  
  PLAY_TMP = """
  void play_%s() {
  %s
  }
  """
  
  def convert(prefix, file_i, file_o):
      a=array.array('B', (open(file_i, 'r').read()))
      i,j=analyze(a)
      b=array.array('B', compress(a,i,j)).tostring()
      print "size=", len(b)
      out=open(file_o, "w+")
      for l, i in enumerate(range(0, len(b), SEGMENT_MAX)):
          segment=b[i:i+SEGMENT_MAX]
          out.write( SEGMENT_TMP % (prefix, l, len(segment), prefix, l, repr(segment).replace("'", '"')))
      out.write(PLAY_TMP % (prefix, "\n".join(map(lambda i: "avr_sound_play(%s%d, %s%d_len);" % (prefix, i, prefix, i), range(l+1)))))
      out.close();
  
  def main():
    file_i=sys.argv[1]
    prefix='.'.join(os.path.basename(file_i).split('.')[:1])
    file_o=os.path.join(os.path.dirname(file_i), prefix+".h")
    convert(prefix, file_i, file_o)
  
  if __name__ == "__main__":
      main()
  </code></pre>
  
  <p>Command prompt gives me this error message when I try to convert the file.</p>
  
  <pre><code>  File "snd2h.py", line 23
      print "size=", + len(b)
                  ^
  SyntaxError: invalid syntax
  </code></pre>