File size: 645 Bytes
7cbe545 afdce78 7cbe545 | 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 | #include "inflect_tts.hpp"
#include <iostream>
#include <fstream>
int main(int argc, char* argv[]) {
if (argc < 2) {
std::cerr << "Usage: tts_example <text>" << std::endl;
return 1;
}
TTSEngine engine("../models/inflect_encoder.axmodel", "../models/inflect_decoder.axmodel");
auto waveform = engine.synthesize(argv[1]);
// Save as raw PCM
std::ofstream out("output.pcm", std::ios::binary);
out.write(reinterpret_cast<const char*>(waveform.data()),
waveform.size() * sizeof(float));
std::cout << "Generated " << waveform.size() << " samples at 24kHz" << std::endl;
return 0;
}
|