Code explanation please

Craig E. Smith craigesmith at
Thu Jan 3 16:33:22 EST 2002

The piece of code below is taken from the Myp3 project. Can someone
explain to me the need/reason for the flush() call after each write()
to pin? Thanks in advance.

def play(self, filename):
		# play a file

		self.debug("PLAY " + filename)
		self.state = "play"

		# stop the player, then flush to send the command
		if self.state == "play":"stop\012")

		# as long as the file is present, then open the file, and start to
play it
		if (len(filename) > 0):"input_open " + filename + "\012play\012")
		#between commenting this and the timeout value of 0.1 in
handle_audio (see below)
		#considerable speedups and timer accuracy can be had"input_position_range 1\012")

More information about the Python-list mailing list