cleanup
This commit is contained in:
@@ -17,11 +17,11 @@ wf = wave.open(sys.argv[1], 'rb')
|
||||
p = pyaudio.PyAudio()
|
||||
|
||||
# open stream based on the wave object which has been input.
|
||||
stream = p.open(format = p.get_format_from_width(wf.getsampwidth()),
|
||||
channels = wf.getnchannels(),
|
||||
rate = wf.getframerate(),
|
||||
output = True,
|
||||
output_device_index = RESPEAKER_INDEX)
|
||||
stream = p.open(format=p.get_format_from_width(wf.getsampwidth()),
|
||||
channels=wf.getnchannels(),
|
||||
rate=wf.getframerate(),
|
||||
output=True,
|
||||
output_device_index=RESPEAKER_INDEX)
|
||||
|
||||
# read data (based on the chunk size)
|
||||
data = wf.readframes(chunk)
|
||||
|
||||
@@ -25,7 +25,6 @@ frames = []
|
||||
|
||||
for i in range(0, int(RESPEAKER_RATE / CHUNK * RECORD_SECONDS)):
|
||||
data = stream.read(CHUNK)
|
||||
print("read a chunk")
|
||||
frames.append(data)
|
||||
|
||||
print("* done recording")
|
||||
|
||||
Reference in New Issue
Block a user