babylon.cpp
v0.0.2

Babylon.cpp ist eine C- und C ++ - Bibliothek für Graphem to Phonem Conversion und Text in die Sprachsynthese. Für die Phonemisierung wird ein Onnx -Laufzeitport des Deepphonemizer -Modells verwendet. Für Sprachsynthese werden Vits verwendet. Pipermodelle sind kompatibel, nachdem ein Konvertierungsskript ausgeführt wurde.
Um die Bibliothek zu erstellen und auszuführen, führen Sie die folgenden Befehle aus:
make
./bin/babylon_example Um die Kompilierungszeit standardmäßig zu verkürzen, verwendet die Libary die von Microsoft bereitgestellten freigegebenen freigegebenen Bibliotheken. Dies kann durch Einstellen BABYLON_BUILD_SOURCE auf ON überschrieben werden.
#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 ;
}