def zeros(dur=None):
  """
  Zeros/zeroes stream generator.
  You may sum your endless stream by this to enforce an end to it.

  Parameters
  ----------
  dur :
    Duration, in number of samples; endless if not given.

  Returns
  -------
  Stream that repeats "0.0" during a given time duration (if any) or
  endlessly.

  """
  if dur is None or (isinf(dur) and dur > 0):
    while True:
      yield 0.0
  for x in xrange(int(.5 + dur)):
    yield 0.0