我需要用 python 记录一个网络通话。
我设法用sounddevice模块录制了麦克风的声音,但这不是我想要的,我需要同时录制麦克风和计算机的声音,这是另一个声音。
这就是我录制麦克风的方法:
import sounddevice as sd
from scipy.io.wavfile import write
fs = 44100 # Sample rate
seconds = 5 # Duration of recording
myrecording = sd.rec(int(seconds * fs), samplerate=fs, channels=2)
sd.wait() # Wait until recording is finished
write('output.wav', fs, myrecording) # Save as WAV file
我还尝试通过在录制行之前添加此行将输入设备更改为立体声混音器来录制计算机声音:
sd.default.device = "stereo input", "speaker output"
但是输出质量真的很差,那只是没有麦克风声音的电脑声音。
如果有任何解决方案,我真的很感激