babylon.cpp
v0.0.2

Babylon.cpp es una biblioteca C y C ++ para la conversión de Grapheme a Foneme y el texto a la síntesis del habla. Para la fonemización, se utiliza un puerto de tiempo de ejecución ONNX del modelo Deepphonemizer. Para los modelos VITS de síntesis del habla se utilizan. Los modelos Piper son compatibles después de ejecutar un script de conversión.
Para construir y ejecutar la biblioteca, ejecute los siguientes comandos:
make
./bin/babylon_example Para reducir el tiempo de compilación de forma predeterminada, Libary usa bibliotecas compartidas en NXRuntime proporcionadas por Microsoft. Esto se puede anular configurando BABYLON_BUILD_SOURCE en 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 ;
}