code: def chunks(seq, size=None, dfmt="f", byte_order=None, padval=0.):
    
    if size is None:
      size = chunks.size
    chunk = array.array(dfmt, xrange(size))
    idx = 0
  
    for el in seq:
      chunk[idx] = el
      idx += 1
      if idx == size:
        yield chunk.tostring()
        idx = 0
  
    if idx != 0:
      for idx in xrange(idx, size):
        chunk[idx] = padval
      yield chunk.tostring()
docs: Chunk generator based on the array module (Python standard library).
  
    See chunk.struct for more help. This strategy uses array.array (random access
    by indexing management) instead of struct.Struct and blocks/deque (circular
    queue appending) from the chunks.struct strategy.
  
    Hint
    ----
    Try each one to find the faster one for your machine, and chooses
    the default one by assigning ``chunks.default = chunks.strategy_name``.
    It'll be the one used by the AudioIO/AudioThread playing mechanism.
  
    Note
    ----
    The ``dfmt`` symbols for arrays might differ from structs' defaults.