C# 调用 VITS,推理模型 将文字转wav音频调试 -数字人分支

C# 调用 VITS,推理模型 将文字转wav音频调试 -数字人分支_第1张图片

Microsoft.ML.OnnxRuntime.OnnxRuntimeException: [ErrorCode:InvalidArgument] Input name: 'input_name' is not in the metadata
   在 Microsoft.ML.OnnxRuntime.InferenceSession.LookupInputMetadata(String nodeName) 位置 D:\a\_work\1\s\csharp\src\Microsoft.ML.OnnxRuntime\InferenceSession.shared.cs:行号 862
   在 Microsoft.ML.OnnxRuntime.InferenceSession.LookupUtf8Names[T](IReadOnlyCollection`1 values, NameExtractor`1 nameExtractor, MetadataLookup metaLookup) 位置 D:\a\_work\1\s\csharp\src\Microsoft.ML.OnnxRuntime\InferenceSession.shared.cs:行号 920
   在 Microsoft.ML.OnnxRuntime.InferenceSession.Run(IReadOnlyCollection`1 inputs, IReadOnlyCollection`1 outputNames, RunOptions options) 位置 D:\a\_work\1\s\csharp\src\Microsoft.ML.OnnxRuntime\InferenceSession.shared.cs:行号 250
   在 Microsoft.ML.OnnxRuntime.InferenceSession.Run(IReadOnlyCollection`1 inputs) 位置 D:\a\_work\1\s\csharp\src\Microsoft.ML.OnnxRuntime\InferenceSession.shared.cs:行号 224
   在 CyberWin.Trade.AGILoader.Form1.btn_启动_Click(Object sender, EventArgs e) 位置 D:\MyWork\aiwlzc\CyberWin.Trade.AGILoader\CyberWin.Trade.AGILoader\Form1.cs:行号 37
   在 System.Windows.Forms.Control.OnClick(EventArgs e)

 VITS(Variational Inference with adversarial learning for end-to-end Text-to-Speech)是一种结合变分推理(variational inference)、标准化流(normalizing flows)和对抗训练的高表现力语音合成模型。VITS通过隐变量而非频谱串联起来语音合成中的声学模型和声码器,在隐变量上进行随机建模并利用随机时长预测器,提高了合成语音的多样性,输入

模型下载

vits — sherpa 1.3 documentation

python 运行

cd /path/to/sherpa-onnx

python3 ./python-api-examples/offline-tts-play.py \
 --vits-model=./vits-melo-tts-zh_en/model.onnx \
 --vits-lexicon=./vits-melo-tts-zh_en/lexicon.txt \
 --vits-tokens=./vits-melo-tts-zh_en/tokens.txt \
 --vits-dict-dir=./vits-melo-tts-zh_en/dict \
 --output-filename=./zh-en-3.wav \
 "它也支持繁体字. 我相信你們一定聽過愛迪生說過的這句話Genius is one percent inspiration and ninety-nine percent perspiration. "

C++ 命令

 cd /path/to/sherpa-onnx

./build/bin/sherpa-onnx-offline-tts \
  --vits-model=./vits-piper-en_US-glados/en_US-glados.onnx\
  --vits-tokens=./vits-piper-en_US-glados/tokens.txt \
  --vits-data-dir=./vits-piper-en_US-glados/espeak-ng-data \
  --output-filename=./glados-liliana.wav \
  "liliana, the most beautiful and lovely assistant of our team!"

./build/bin/sherpa-onnx-offline-tts \
  --vits-model=./vits-piper-en_US-glados/en_US-glados.onnx\
  --vits-tokens=./vits-piper-en_US-glados/tokens.txt \
  --vits-data-dir=./vits-piper-en_US-glados/espeak-ng-data \
  --output-filename=./glados-code.wav \
  "Talk is cheap. Show me the code."

./build/bin/sherpa-onnx-offline-tts \
  --vits-model=./vits-piper-en_US-glados/en_US-glados.onnx\
  --vits-tokens=./vits-piper-en_US-glados/tokens.txt \
  --vits-data-dir=./vits-piper-en_US-glados/espeak-ng-data \
  --output-filename=./glados-men.wav \
   "Today as always, men fall into two groups: slaves and free men. Whoever does not have two-thirds of his day for himself, is a slave, whatever he may be: a statesman, a businessman, an official, or a scholar."

你可能感兴趣的:(c#,开发语言,人工智能,数字人)