Build fixes: - Add missing includes (<cstdint>, <iomanip>, <sstream>, <string>, <vector>) - Fix unused parameter warnings with (void) casts - Fix cpp-httplib API: Use UploadFormDataItems instead of MultipartFormDataItems - Fix portaudio linking: Use portaudio_static target instead of portaudio All modules now compile without errors. Executable built successfully (13MB). 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude <noreply@anthropic.com>
59 lines
1.9 KiB
C++
59 lines
1.9 KiB
C++
#include <iostream>
|
|
#include "utils/Config.h"
|
|
#include "core/Pipeline.h"
|
|
|
|
int main(int argc, char** argv) {
|
|
(void)argc; // Unused
|
|
(void)argv; // Unused
|
|
std::cout << "SecondVoice - Real-time Translation System" << std::endl;
|
|
std::cout << "===========================================" << std::endl;
|
|
|
|
// Load configuration
|
|
secondvoice::Config& config = secondvoice::Config::getInstance();
|
|
if (!config.load("config.json", ".env")) {
|
|
std::cerr << "Failed to load configuration" << std::endl;
|
|
return 1;
|
|
}
|
|
|
|
std::cout << "Configuration loaded successfully" << std::endl;
|
|
std::cout << "Audio: " << config.getAudioConfig().sample_rate << "Hz, "
|
|
<< config.getAudioConfig().channels << " channel(s), "
|
|
<< config.getAudioConfig().chunk_duration_seconds << "s chunks" << std::endl;
|
|
std::cout << "Whisper: " << config.getWhisperConfig().model
|
|
<< " (language: " << config.getWhisperConfig().language << ")" << std::endl;
|
|
std::cout << "Claude: " << config.getClaudeConfig().model << std::endl;
|
|
std::cout << std::endl;
|
|
|
|
// Create and initialize pipeline
|
|
secondvoice::Pipeline pipeline;
|
|
if (!pipeline.initialize()) {
|
|
std::cerr << "Failed to initialize pipeline" << std::endl;
|
|
return 1;
|
|
}
|
|
|
|
std::cout << "Pipeline initialized successfully" << std::endl;
|
|
std::cout << "Starting recording and translation..." << std::endl;
|
|
std::cout << std::endl;
|
|
|
|
// Start pipeline
|
|
if (!pipeline.start()) {
|
|
std::cerr << "Failed to start pipeline" << std::endl;
|
|
return 1;
|
|
}
|
|
|
|
// Wait for pipeline to finish (user clicks Stop button)
|
|
while (pipeline.isRunning()) {
|
|
std::this_thread::sleep_for(std::chrono::milliseconds(100));
|
|
}
|
|
|
|
std::cout << std::endl;
|
|
std::cout << "Recording stopped" << std::endl;
|
|
std::cout << "Saving audio..." << std::endl;
|
|
|
|
pipeline.stop();
|
|
|
|
std::cout << "Done!" << std::endl;
|
|
|
|
return 0;
|
|
}
|