trying to fix deprecated numpy code
This commit is contained in:
@@ -27,8 +27,8 @@ 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)
|
||||||
# extract channel 0 data from 2 channels, if you want to extract channel 1, please change to [1::2]
|
# extract channel 0 data from 2 channels, if you want to extract channel 1, please change to [1::2]
|
||||||
a = np.fromstring(data,dtype=np.int16)[0::2]
|
a = np.frombuffer(data, dtype=np.int16)[0::2]
|
||||||
frames.append(a.tostring())
|
frames.append(a.tobytes())
|
||||||
|
|
||||||
print("* done recording")
|
print("* done recording")
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user