Skip to content

Add C++ runtime for vocos #2014

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 3 commits into from
Mar 17, 2025
Merged

Add C++ runtime for vocos #2014

merged 3 commits into from
Mar 17, 2025

Conversation

csukuangfj
Copy link
Collaborator

@csukuangfj csukuangfj commented Mar 17, 2025

with vocos

./build/bin/sherpa-onnx-offline-tts \
  --matcha-acoustic-model=./matcha-icefall-en_US-ljspeech/model-steps-3.onnx \
  --matcha-vocoder=./vocos-22khz-univ.onnx \
  --matcha-tokens=./matcha-icefall-en_US-ljspeech/tokens.txt \
  --matcha-data-dir=./matcha-icefall-en_US-ljspeech/espeak-ng-data \
  --num-threads=1 \
  "How are you doing today? 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."
/Users/fangjun/open-source/sherpa-onnx/sherpa-onnx/csrc/parse-options.cc:Read:375 ./build/bin/sherpa-onnx-offline-tts --matcha-acoustic-model=./matcha-icefall-en_US-ljspeech/model-steps-3.onnx --matcha-vocoder=./vocos-22khz-univ.onnx --matcha-tokens=./matcha-icefall-en_US-ljspeech/tokens.txt --matcha-data-dir=./matcha-icefall-en_US-ljspeech/espeak-ng-data --num-threads=1 'How are you doing today? 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.'

sample=37632, progress=0.333333
sample=112260, progress=0.666667
sample=216235, progress=1.000000
Elapsed seconds: 1.930 s
Audio duration: 16.604 s
Real-time factor (RTF): 1.930/16.604 = 0.116

With hifigan_v2

./build/bin/sherpa-onnx-offline-tts \
  --matcha-acoustic-model=./matcha-icefall-en_US-ljspeech/model-steps-3.onnx \
  --matcha-vocoder=./hifigan_v2.onnx \
  --matcha-tokens=./matcha-icefall-en_US-ljspeech/tokens.txt \
  --matcha-data-dir=./matcha-icefall-en_US-ljspeech/espeak-ng-data \
  --num-threads=1 \
 "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."
/Users/fangjun/open-source/sherpa-onnx/sherpa-onnx/csrc/parse-options.cc:Read:375 ./build/bin/sherpa-onnx-offline-tts --matcha-acoustic-model=./matcha-icefall-en_US-ljspeech/model-steps-3.onnx --matcha-vocoder=./hifigan_v2.onnx --matcha-tokens=./matcha-icefall-en_US-ljspeech/tokens.txt --matcha-data-dir=./matcha-icefall-en_US-ljspeech/espeak-ng-data --num-threads=1 '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.'

sample=112568, progress=0.500000
sample=217343, progress=1.000000
Elapsed seconds: 2.315 s
Audio duration: 14.962 s
Real-time factor (RTF): 2.315/14.962 = 0.155
The text is: 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.. Speaker ID: 0
Saved to ./generated.wav successfully!

@csukuangfj csukuangfj merged commit 0aacf02 into k2-fsa:master Mar 17, 2025
1 of 135 checks passed
@csukuangfj csukuangfj deleted the cpp-vocos branch March 19, 2025 02:16
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant