This commit is contained in:
yumoqing 2024-09-14 21:00:38 +08:00
parent 3e49fe39c7
commit 5d0298ef06

View File

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