#include "piper_tts_interface.h" #include #include int main() { PiperTTSInterface tts_processor; // 示例 1: 只提供文本和输出文件名 std::string text1 = "你好,世界。温度传感器出现故障。只需输入文本即可。"; std::string file1 = "hello_world.wav"; if (tts_processor.text_to_speech(text1, file1)) { std::cout << "Audio for '" << text1 << "' generated successfully!" << std::endl; } else { std::cerr << "Failed to generate audio for '" << text1 << "'." << std::endl; } return 0; }