title: Play square wave SciPy and PyAudio
body: <p>I'm trying to play square waves generated using SciPy with PyAudio but I get the error</p>
  
  <blockquote>
    <p>TypeError: len() of unsized object</p>
  </blockquote>
  
  <p>which is kind of strange because the square wave object should have a size, right?</p>
  
  <pre><code>RATE = 48000
  p = pyaudio.PyAudio()
  stream = p.open(format = pyaudio.paInt16,
              channels = 2,
              rate = RATE,
              output = True)
  # ... inside a loop
      wav = signal.square(2*math.pi*FREQ*t)
      wav = wav.astype(np.int16)
      stream.write(wav) # crash here
  </code></pre>
  
  <p>The crash happens on the first iteration of the loop, so I suppose the loop is not a problem.</p>