Пример #1
0
				# Initialize PyAudio


def countdown(secs):
	while secs > 0:
		print secs
		sleep(1)
		secs -= 1
				
#
# STAGE 1
#
# Run analyse on input stream
#
if RECORDING:
	midi_player.play(60 + Notes.C)
	countdown(3)
	print "Sing!"
	
	# Open input stream, 16-bit mono at 44100 Hz
	AUDIO_INPUT = p.open(
		format = pyaudio.paInt16,
		channels = 1,
		rate = 44100,
		input_device_index = 1,
		input = True)
	
	chr = 0
	i = 0
	while chr == 0:
		# Read raw microphone data
Пример #2
0
p = pyaudio.PyAudio()



def countdown(secs):
	while secs > 0:
		print secs
		sleep(1)
		secs -= 1
				
#
# STAGE 1
#
# Run analyse on input stream
#
midi_player.play(60 + Notes.C)
countdown(2)
print "Sing!"

# Open input stream, 16-bit mono at 44100 Hz
AUDIO_INPUT = p.open(
	format = pyaudio.paInt16,
	channels = 1,
	rate = 44100,
	input_device_index = 1,
	input = True)


	
chr = 0
time = 0