python变声方法

编程入门 行业动态 更新时间:2024-10-22 14:25:37

python变声<a href=https://www.elefans.com/category/jswz/34/1771314.html style=方法"/>

python变声方法

通过调整采样频率和移动音调变声,这里的librosa可以更新到最新版本,保存使用soundfile库


import librosa
import soundfile as sf
import librosa.display
import matplotlib.pyplot as pltdef adjust_tone(spk_id):out_path=f"yyy.wav"input_audio =f'xxx.wav'y, sr = librosa.load(input_audio) # 22050# 通过移动音调变声 ,14是上移14个半步, 如果是 -14 下移14个半步b = librosa.effects.pitch_shift(y, sr, n_steps=3)sf.write(out_path, b, sr)def adjust_tone_2(spk_id):out_path=f"yyy.wav"input_audio =f'xxx.wav'y, sr = librosa.load(input_audio) # 22050# 提高采样率,语速变快,音调变高,变小孩声音sr= 29000sf.write(out_path, b, sr)

更多推荐

python变声方法

本文发布于:2024-03-05 14:14:21,感谢您对本站的认可!
本文链接:https://www.elefans.com/category/jswz/34/1712511.html
版权声明:本站内容均来自互联网,仅供演示用,请勿用于商业和其他非法用途。如果侵犯了您的权益请与我们联系,我们将在24小时内删除。
本文标签:方法   python

发布评论

评论列表 (有 0 条评论)
草根站长

>www.elefans.com

编程频道|电子爱好者 - 技术资讯及电子产品介绍!