GithubHelp home page GithubHelp logo

TTS:调用模型出错 about sherpa-onnx HOT 10 CLOSED

kyn817046 avatar kyn817046 commented on September 28, 2024
TTS:调用模型出错

from sherpa-onnx.

Comments (10)

csukuangfj avatar csukuangfj commented on September 28, 2024
SherpaOnnxOfflineTtsConfig config;
memset(&config, 0, sizeof(config);

Please add memset to zero initialize the struct.

Please see also

memset(&config, 0, sizeof(config));

from sherpa-onnx.

kyn817046 avatar kyn817046 commented on September 28, 2024

Thank you very much! Is there any explanation of parameters in TTS? I have read the document of this information is relatively small, do I not find the place?

from sherpa-onnx.

csukuangfj avatar csukuangfj commented on September 28, 2024

If you use the C++ binary, e.g.,

./build/bin/sherpa-onnx-offline-tts --help

you would see the help message of each member variable of the struct.

from sherpa-onnx.

kyn817046 avatar kyn817046 commented on September 28, 2024

log:

D:\a\sherpa-onnx\sherpa-onnx\sherpa-onnx\c-api\c-api.cc:SherpaOnnxCreateOfflineTts:940 OfflineTtsConfig(model=OfflineTts
ModelConfig(vits=OfflineTtsVitsModelConfig(model="./vits-melo-tts-zh_en/model.onnx", lexicon="./vits-melo-tts-zh_en/lexi
con.txt", tokens="./vits-melo-tts-zh_en/tokens.txt", data_dir="", dict_dir="./vits-melo-tts-zh_en/dict", noise_scale=0.6
67, noise_scale_w=0.8, length_scale=1), num_threads=1, debug=True, provider="cpu"), rule_fsts="./vits-melo-tts-zh_en/dat
e.fst,./vits-melo-tts-zh_en/number.fst", rule_fars="", max_num_sentences=2)

D:\a\sherpa-onnx\sherpa-onnx\sherpa-onnx\csrc\offline-tts-vits-model.cc:Init:79 ---vits model---
version=2
model_type=melo-vits
jieba=1
url=https://github.com/myshell-ai/MeloTTS
comment=melo
language=Chinese + English
add_blank=1
n_speakers=1
sample_rate=44100
bert_dim=1024
ja_bert_dim=768
speaker_id=1
lang_id=3
tone_start=0
license=MIT license
description=MeloTTS is a high-quality multi-lingual text-to-speech library by MyShell.ai
----------input names----------
0 x
1 x_lengths
2 tones
3 sid
4 noise_scale
5 length_scale
6 noise_scale_w
----------output names----------
0 y


D:\a\sherpa-onnx\sherpa-onnx\sherpa-onnx/csrc/offline-tts-vits-impl.h:OfflineTtsVitsImpl:48 rule fst: ./vits-melo-tts-zh
_en/date.fst
D:\a\sherpa-onnx\sherpa-onnx\sherpa-onnx/csrc/offline-tts-vits-impl.h:OfflineTtsVitsImpl:48 rule fst: ./vits-melo-tts-zh
_en/number.fst
D:\a\sherpa-onnx\sherpa-onnx\sherpa-onnx/csrc/offline-tts-vits-impl.h:Generate:165 Raw text: hello world,你好世界!This i
s a test of the speech synthesis system.
D:\a\sherpa-onnx\sherpa-onnx\sherpa-onnx/csrc/offline-tts-vits-impl.h:Generate:172 After normalizing: hello world,你好世
界!This is a test of the speech synthesis system.
D:\a\sherpa-onnx\sherpa-onnx\sherpa-onnx/csrc/offline-tts-vits-impl.h:Generate:172 After normalizing: hello world,你好世
界!This is a test of the speech synthesis system.
D:\a\sherpa-onnx\sherpa-onnx\sherpa-onnx\csrc\jieba-lexicon.cc:ConvertTextToTokenIds:77 input text: hello world,你好世界
!This is a test of the speech synthesis system.
D:\a\sherpa-onnx\sherpa-onnx\sherpa-onnx\csrc\jieba-lexicon.cc:ConvertTextToTokenIds:78 after replacing punctuations: he
llo world,你好世界!This is a test of the speech synthesis system。
D:\a\sherpa-onnx\sherpa-onnx\sherpa-onnx\csrc\jieba-lexicon.cc:ConvertTextToTokenIds:87 after jieba processing: hello_ _
world_,_你好_世界_!_This_ _is_ _a_ _test_ _of_ _the_ _speech_ _synthesis_ _system_.

code:
tts = SherpaOnnxCreateOfflineTts(&config);

if (tts == nullptr) {
	std::cerr << "Failed to initialize TTS engine." << std::endl;
	return;
}

const std::string text = "hello world,你好世界!This is a test of the speech synthesis system.";
int32_t sid = 0;
const char* filename =_strdup("./x64/Release/generated.wav");

const SherpaOnnxGeneratedAudio* audio = SherpaOnnxOfflineTtsGenerate(tts, text.c_str(), sid, 1.0);

image
I followed the sample code and ran it, reporting errors as above. Do you have time to take a look?

from sherpa-onnx.

csukuangfj avatar csukuangfj commented on September 28, 2024

Please update your sherpa-onnx to the latest master, re-build sherpa-onnx, and re-try.

from sherpa-onnx.

csukuangfj avatar csukuangfj commented on September 28, 2024

@kyn817046

Does it work for you now?

from sherpa-onnx.

kyn817046 avatar kyn817046 commented on September 28, 2024

I downloaded and compiled the latest project and still reported this error

from sherpa-onnx.

csukuangfj avatar csukuangfj commented on September 28, 2024

Please show

git log

to verify the version of your sherpa-onnx
and please tell us how you build sherpa-onnx and post the build logs.

from sherpa-onnx.

kyn817046 avatar kyn817046 commented on September 28, 2024

Thank you very much! The latest version can run.

from sherpa-onnx.

csukuangfj avatar csukuangfj commented on September 28, 2024

Thank you very much! The latest version can run.

Great!

from sherpa-onnx.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.