Initializes the stream.

def run(self):
		""" Initializes the stream. """
		if not hasattr(self, 'queue'):
			raise RuntimeError("Audio queue is not intialized.")
		self.keep_listening = True
		self.stream.start()
		
		while self.keep_listening:
			try:
				chunk = self.queue.get(timeout=queue_timeout)
				underflowed = self.stream.write(chunk)
				if underflowed:
					logger.debug("Buffer underrun")
			except Empty:
				pass

		self.stream.stop()
		self.stream.close()