文本轉(zhuǎn)語音
項目地址:https://github.com/coqui-ai/TTS
環(huán)境安裝:
- 下載項目;
- 安裝Python,安裝項目依賴:
pip install TTS
1. 下載安裝AI模型:
https://github.com/facebookresearch/fairseq/tree/main/examples/mms
模型文件放到:C:\Users\Administrator\AppData\Local\tts
2. 將文本轉(zhuǎn)換為語音:
tts --text “要轉(zhuǎn)換的文本內(nèi)容” --model_name “指定語音模型” --out_path .\outFile.wav?
語音模型可通過命令tts –list_models列出
示例(使用中文語音模型):
tts --text "你好,中文。" --model_name "tts_models/zh-CN/baker/tacotron2-DDC-GST" --out_path .\test.wav
3. 自定義人聲:
就是給定一段語音,生成語音的音色就會與給定語音相似。也就是自定義人聲。
自定義人聲需要依賴xtts模型,下載地址:https://huggingface.co/coqui/XTTS-v2/tree/main
也可以通過以下命令行下載:
git lfs install
git clone https://huggingface.co/coqui/XTTS-v2
?下載的模型文件必須放到特定文件夾:C:\Users\Administrator\AppData\Local\tts\tts_models--multilingual--multi-dataset--xtts_v2
?使用以下命令生成自定義人聲的語音:
tts --model_name tts_models/multilingual/multi-dataset/xtts_v2 --language_idx zh-cn --speaker_wav ./out/output.wav --text "感謝榜一大哥,王思春送來的一發(fā)火箭。" --out_path ./out/ai_output.wav
語音轉(zhuǎn)語音(變聲)
項目地址:https://github.com/voicepaw/so-vits-svc-fork
1. 環(huán)境安裝:
- 下載項目;
- 安裝依賴:pip install –r requirements.txt
- 下載語音模型:
https://huggingface.co/models?search=so-vits-svc
https://civitai.com/?query=so-vits-svc
模型存放目錄結(jié)構(gòu)configs/模型文件.pth;configs/44k/config.json
2. 使用方法:
1. GUI使用:
命令: svc gui打開UI界面
選擇模型文件、模型配置文件、原語音文件wav;
點擊Infer按鈕生成語音文件;
2. 使用命令行:
svc infer C:\Users\Administrator\Desktop\test.wav -m "C:\Users\Administrator\Desktop\configs"
視頻同步語音口型
項目地址:https://github.com/OpenTalker/video-retalking
1. 環(huán)境安裝:
- 下載項目;
- 安裝conda:Index of /anaconda/miniconda/ | 清華大學(xué)開源軟件鏡像站 | Tsinghua Open Source Mirror
- 使用conda創(chuàng)建python環(huán)境:
conda create -n video_retalking python=3.8
conda activate video_retalking
- 安裝依賴:
conda install ffmpeg文章來源:http://www.zghlxwxcb.cn/news/detail-826487.html
pip install -r requirements.txt
- AI模型下載:https://drive.google.com/drive/folders/18rhjMpxK8LVVxf7PI6XwOidt8Vouv_H0?usp=share_link
在項目工程下新建checkpoints文件夾并將模型全部文件放入文件夾;文章來源地址http://www.zghlxwxcb.cn/news/detail-826487.html
2. 使用方法:
.\inference --face 3.mp4 --audio D:\Workspace\TTS-0.21.3\test.wav --outfile C:\Users\Administrator\Desktop\out_3.mp4
到了這里,關(guān)于【AI】文本轉(zhuǎn)語音 變聲 音色克隆 數(shù)字人音視頻口型同步AI應(yīng)用的文章就介紹完了。如果您還想了解更多內(nèi)容,請在右上角搜索TOY模板網(wǎng)以前的文章或繼續(xù)瀏覽下面的相關(guān)文章,希望大家以后多多支持TOY模板網(wǎng)!