babylon.cpp
v0.0.2

Babylon.cpp是CH和C ++库,用于素式转换和文本到语音合成。为了进行音调,使用Deepphonemizer模型的ONNX运行时端口。用于语音合成模型。运行转换脚本后,Piper模型是兼容的。
构建和运行库运行以下命令:
make
./bin/babylon_example为了减少编译时间,Libary使用Microsoft提供的OnnxRuntime共享库。可以通过将BABYLON_BUILD_SOURCE设置为ON来覆盖这一点。
#include "babylon.h"
int main () {
babylon_g2p_options_t options = {
. language = "en_us" ,
. use_dictionaries = 1 ,
. use_punctuation = 1 ,
};
babylon_g2p_init ( "path/to/deep_phonemizer.onnx" , options );
const char * text = "Hello World" ;
babylon_tts_init ( "path/to/vits.onnx" );
babylon_tts ( text , "path/to/output.wav" );
babylon_tts_free ();
babylon_g2p_free ();
return 0 ;
}# include " babylon.hpp "
int main () {
DeepPhonemizer::Session dp ( " path/to/deep_phonemizer.onnx " );
Vits::Session vits ( " path/to/vits.onnx " );
std::string text = " Hello World " ;
std::vector<std::string> phonemes = dp. g2p (text);
vits. tts (phonemes, " path/to/output.wav " );
return 0 ;
}