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