0

我想剪切音频文件。但是,每当我剪切它时,都会在我剪切音频的地方添加一个小故障,一种剪切噪音。我怎样才能消除这种噪音?

我用来录制音频的代码是:

import sounddevice as sd
from scipy.io.wavfile import write

fs = 16000  # Sample rate
seconds = 1.5  # Duration of recording

myrecording = sd.rec(int(seconds*fs), samplerate=fs, channels=1, dtype='int16') #recor the audio
sd.wait()  # Wait until recording is finished
myrecording=myrecording[8000:] #get one second data
write('output.wav', fs, myrecording)  # Save as WAV file

提前致谢。

4

0 回答 0