thewh1teagle / sherpa-rs

Rust bindings to https://github.com/k2-fsa/sherpa-onnx
MIT License
38 stars 10 forks source link

bug: tts[in windows], text is chinese #17

Open ghjdegithub opened 2 weeks ago

ghjdegithub commented 2 weeks ago

os: windows 10 when use examples\tts.rs. use params: -- text "真诚就是不欺人也不自欺。热爱就是全心投入并享受其中。" error:

image
ghjdegithub commented 2 weeks ago

os: windows 10 when use examples\tts.rs. use params: -- text "真诚就是不欺人也不自欺。热爱就是全心投入并享受其中。" error: image

This is what happens when it runs under debug.

When I run it under release it is just fine.

thewh1teagle commented 2 weeks ago

@ghjdegithub

Can you try edit the text in the file and pass it directly instead of passing it from the console?

ghjdegithub commented 2 weeks ago

@ghjdegithub

Can you try edit the text in the file and pass it directly instead of passing it from the console?

I tried hardcoding this string of Chinese text directly, same error as this one.

ghjdegithub commented 2 weeks ago

@ghjdegithub

Can you try edit the text in the file and pass it directly instead of passing it from the console?

My initial guess is that there's something wrong with rust's string to cstring conversion macro in debug mode

thewh1teagle commented 2 weeks ago

@ghjdegithub

What's the exact model you use? (and tokens file & lexicon)

ghjdegithub commented 2 weeks ago

@ghjdegithub

What's the exact model you use? (and tokens file & lexicon)您使用的具体型号是什么? (以及标记文件和词典)

Here are my input parameters: --text "真诚就是不欺人也不自欺。热爱就是全心投入并享受其中。" --output audio.wav --tokens "vits-zh-hf-theresa/tokens.txt" --model "vits-zh-hf-theresa/theresa.onnx" --lexicon "vits-zh-hf-theresa/lexicon.txt" --dict-dir "vits-zh-hf-theresa/dict"

thewh1teagle commented 2 weeks ago

@ghjdegithub

It works for me without errors on WIndows 11.

wget https://github.com/k2-fsa/sherpa-onnx/releases/download/tts-models/vits-zh-hf-theresa.tar.bz2
tar xvf vits-zh-hf-theresa.tar.bz2
rm vits-zh-hf-theresa.tar.bz2
cargo run --example tts -- --text "真诚就是不欺人也不自欺。热爱就是全心投入并享受其中。" --output audio.wav --tokens "vits-zh-hf-theresa/tokens.txt" --model "vits-zh-hf-theresa/theresa.onnx" --lexicon "vits-zh-hf-theresa/lexicon.txt" --dict-dir "vits-zh-hf-theresa/dict"
ghjdegithub commented 2 weeks ago

@ghjdegithub

It works for me without errors on WIndows 11.


wget https://github.com/k2-fsa/sherpa-onnx/releases/download/tts-models/vits-zh-hf-theresa.tar.bz2

tar xvf vits-zh-hf-theresa.tar.bz2

rm vits-zh-hf-theresa.tar.bz2

cargo run --example tts -- --text "真诚就是不欺人也不自欺。热爱就是全心投入并享受其中。" --output audio.wav --tokens "vits-zh-hf-theresa/tokens.txt" --model "vits-zh-hf-theresa/theresa.onnx" --lexicon "vits-zh-hf-theresa/lexicon.txt" --dict-dir "vits-zh-hf-theresa/dict"

Mine is win10.