code: def write(self, buf):
          
          underflow = self._audio_stream.write(buf)
          if underflow:
              logging.warning('SoundDeviceStream write underflow (size: %d)',
                              len(buf))
          return len(buf)
docs: Write bytes to the stream.