|
|
|
@ -19,8 +19,8 @@
|
|
|
|
|
#endif
|
|
|
|
|
|
|
|
|
|
#ifdef _WIN32
|
|
|
|
|
#include <io.h>
|
|
|
|
|
#include <fcntl.h>
|
|
|
|
|
#include <fcntl.h>
|
|
|
|
|
#include <io.h>
|
|
|
|
|
#endif
|
|
|
|
|
|
|
|
|
|
#ifdef __APPLE__
|
|
|
|
@ -85,6 +85,9 @@ struct RunConfig {
|
|
|
|
|
|
|
|
|
|
// Seconds of extra silence to insert after a single phoneme
|
|
|
|
|
optional<std::map<piper::Phoneme, float>> phonemeSilenceSeconds;
|
|
|
|
|
|
|
|
|
|
// true to use CUDA execution provider
|
|
|
|
|
bool useCuda = false;
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
void parseArgs(int argc, char *argv[], RunConfig &runConfig);
|
|
|
|
@ -114,7 +117,8 @@ int main(int argc, char *argv[]) {
|
|
|
|
|
|
|
|
|
|
auto startTime = chrono::steady_clock::now();
|
|
|
|
|
loadVoice(piperConfig, runConfig.modelPath.string(),
|
|
|
|
|
runConfig.modelConfigPath.string(), voice, runConfig.speakerId);
|
|
|
|
|
runConfig.modelConfigPath.string(), voice, runConfig.speakerId,
|
|
|
|
|
runConfig.useCuda);
|
|
|
|
|
auto endTime = chrono::steady_clock::now();
|
|
|
|
|
spdlog::info("Loaded voice in {} second(s)",
|
|
|
|
|
chrono::duration<double>(endTime - startTime).count());
|
|
|
|
@ -314,8 +318,8 @@ int main(int argc, char *argv[]) {
|
|
|
|
|
|
|
|
|
|
#ifdef _WIN32
|
|
|
|
|
// Needed on Windows to avoid terminal conversions
|
|
|
|
|
setmode(fileno(stdout),O_BINARY);
|
|
|
|
|
setmode(fileno(stdin),O_BINARY);
|
|
|
|
|
setmode(fileno(stdout), O_BINARY);
|
|
|
|
|
setmode(fileno(stdin), O_BINARY);
|
|
|
|
|
#endif
|
|
|
|
|
|
|
|
|
|
thread rawOutputThread(rawOutputProc, ref(sharedAudioBuffer),
|
|
|
|
@ -434,10 +438,11 @@ void printUsage(char *argv[]) {
|
|
|
|
|
cerr << " --json-input stdin input is lines of JSON "
|
|
|
|
|
"instead of plain text"
|
|
|
|
|
<< endl;
|
|
|
|
|
cerr << " --debug print DEBUG messages to the console"
|
|
|
|
|
cerr << " --use-cuda use CUDA execution provider"
|
|
|
|
|
<< endl;
|
|
|
|
|
cerr << " -q --quiet disable logging"
|
|
|
|
|
cerr << " --debug print DEBUG messages to the console"
|
|
|
|
|
<< endl;
|
|
|
|
|
cerr << " -q --quiet disable logging" << endl;
|
|
|
|
|
cerr << endl;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
@ -518,6 +523,8 @@ void parseArgs(int argc, char *argv[], RunConfig &runConfig) {
|
|
|
|
|
runConfig.tashkeelModelPath = filesystem::path(argv[++i]);
|
|
|
|
|
} else if (arg == "--json_input" || arg == "--json-input") {
|
|
|
|
|
runConfig.jsonInput = true;
|
|
|
|
|
} else if (arg == "--use_cuda" || arg == "--use-cuda") {
|
|
|
|
|
runConfig.useCuda = true;
|
|
|
|
|
} else if (arg == "--version") {
|
|
|
|
|
std::cout << piper::getVersion() << std::endl;
|
|
|
|
|
exit(0);
|
|
|
|
|