This commit is contained in:
yumoqing 2024-09-14 20:59:12 +08:00
parent 2452f9f84b
commit 3e49fe39c7

View File

@ -139,7 +139,8 @@ class AudioTrackVad(MediaStreamTrack):
return fs
def frames_write_wave(self, frames):
ndarr = np.frombuffer(b''.join(frames), dtype=np.int16)
fb = [ self.frame2btyes(f) for f in frames ]
ndarr = np.frombuffer(b''.join(fb), dtype=np.int16)
fn = temp_file(suffix='.wav')
write(fn, frames[0].sample_rate, ndarr)
return fn