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 ;
}