我希望在sample
不改变音频速度的情况下将变量中包含的音频音高转换到特定频率。
这是我到目前为止的代码。
import sounddevice as sd
SAMPLE_RATE = 48000
def record_sample():
print("recording...")
recording = sd.rec(int(3 * SAMPLE_RATE))
sd.wait()
print("done recording.")
return recording
def init():
sd.default.samplerate = SAMPLE_RATE
sd.default.channels = 1
init()
sample = record_sample()
sd.play(sample)
sd.wait()
我该怎么做呢?
提前致谢。