Use piper-phonemize to convert text to token IDs (#453)
This commit is contained in:
@@ -8,20 +8,22 @@ fun main() {
|
||||
}
|
||||
|
||||
fun testTts() {
|
||||
// see https://github.com/k2-fsa/sherpa-onnx/releases/tag/tts-models
|
||||
// https://github.com/k2-fsa/sherpa-onnx/releases/download/tts-models/vits-piper-en_US-amy-low.tar.bz2
|
||||
var config = OfflineTtsConfig(
|
||||
model=OfflineTtsModelConfig(
|
||||
vits=OfflineTtsVitsModelConfig(
|
||||
model="./vits-zh-aishell3/vits-aishell3.onnx",
|
||||
lexicon="./vits-zh-aishell3/lexicon.txt",
|
||||
tokens="./vits-zh-aishell3/tokens.txt",
|
||||
model="./vits-piper-en_US-amy-low/en_US-amy-low.onnx",
|
||||
tokens="./vits-piper-en_US-amy-low/tokens.txt",
|
||||
dataDir="./vits-piper-en_US-amy-low/espeak-ng-data",
|
||||
),
|
||||
numThreads=1,
|
||||
debug=true,
|
||||
)
|
||||
)
|
||||
val tts = OfflineTts(config=config)
|
||||
val audio = tts.generate(text="林美丽最美丽!", sid=99, speed=1.2f)
|
||||
audio.save(filename="99.wav")
|
||||
val audio = tts.generate(text="“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.”")
|
||||
audio.save(filename="test-en.wav")
|
||||
}
|
||||
|
||||
fun testAsr() {
|
||||
|
||||
@@ -34,9 +34,10 @@ if [ ! -f ./sherpa-onnx-streaming-zipformer-en-2023-02-21/tokens.txt ]; then
|
||||
git clone https://huggingface.co/csukuangfj/sherpa-onnx-streaming-zipformer-en-2023-02-21
|
||||
fi
|
||||
|
||||
if [ ! -f ./vits-zh-aishell3/tokens.txt ]; then
|
||||
git lfs install
|
||||
git clone https://huggingface.co/csukuangfj/vits-zh-aishell3
|
||||
if [ ! -f ./vits-piper-en_US-amy-low/en_US-amy-low.onnx ]; then
|
||||
wget -q https://github.com/k2-fsa/sherpa-onnx/releases/download/tts-models/vits-piper-en_US-amy-low.tar.bz2
|
||||
tar xf vits-piper-en_US-amy-low.tar.bz2
|
||||
rm vits-piper-en_US-amy-low.tar.bz2
|
||||
fi
|
||||
|
||||
kotlinc-jvm -include-runtime -d main.jar Main.kt WaveReader.kt SherpaOnnx.kt faked-asset-manager.kt Tts.kt
|
||||
|
||||
Reference in New Issue
Block a user