Skip to content

Commit

Permalink
example
Browse files Browse the repository at this point in the history
  • Loading branch information
danemadsen committed Aug 2, 2024
1 parent 9bc7c53 commit 4db02c2
Show file tree
Hide file tree
Showing 3 changed files with 26 additions and 18 deletions.
2 changes: 1 addition & 1 deletion example/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,6 @@ cmake_minimum_required(VERSION 3.18)

project(babylon_example)

add_executable(babylon_example main.c)
add_executable(babylon_example main.cpp)

target_link_libraries(babylon_example babylon)
17 changes: 0 additions & 17 deletions example/main.c

This file was deleted.

25 changes: 25 additions & 0 deletions example/main.cpp
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
#include "babylon.hpp"
#include <iostream>

int main(int argc, char** argv) {
std::string dp_model_path = "./models/deep_phonemizer.onnx";
std::string vits_model_path = "./models/curie.onnx";
std::string text;

if (argc < 2) {
std::cerr << "Usage: babylon <text>" << std::endl;
return 1;
}

text = argv[1];

DeepPhonemizer::Session dp(dp_model_path);

Vits::Session vits(vits_model_path);

std::vector<std::string> phonemes = dp.g2p(text);

vits.tts(phonemes, "./babylon_output.wav");

return 0;
}

0 comments on commit 4db02c2

Please sign in to comment.