def _audio_data_generator(buff):
 stop = False
 while (not stop):
  data = [buff.get()]
  while True:
   try:
    data.append(buff.get(block=False))
   except queue.Empty:
    break
  if (None in data):
   stop = True
   data.remove(None)
  (yield ''.join(data))

def _audio_data_generator ( buff ) : stop = False while ( not stop ) : data = [ buff . get ( ) ] while True : try : data . append ( buff . get ( block = False ) ) except queue . Empty : break if ( None in data ) : stop = True data . remove ( None ) ( yield '' . join ( data ) )
a generator that yields all available data in the given buffer .