diff --git a/lib/src/chunk_processor.cpp b/lib/src/chunk_processor.cpp index a3bb4cb..16b3899 100644 --- a/lib/src/chunk_processor.cpp +++ b/lib/src/chunk_processor.cpp @@ -2,6 +2,8 @@ #include #include #include +#include +#include #include #include @@ -23,6 +25,8 @@ ChunkProcessor::ChunkProcessor(std::string modelPath, &queue_), webrtcVad_(options.webrtcVadLevel, options.sampleRate) { queueThread_ = std::thread([&, modelPath] { + setlocale(LC_ALL, "pt_BR.UTF-8"); + ortMutex_.lock(); if (!ortSession_) { ortEnv_ = std::make_unique(ORT_LOGGING_LEVEL_WARNING, @@ -33,10 +37,10 @@ ChunkProcessor::ChunkProcessor(std::string modelPath, Ort::SessionOptions sessionOptions; sessionOptions.SetIntraOpNumThreads(1); #ifdef _WIN32 - std::wstring wstring(modelPath.begin(), modelPath.end()); - ortSession_ = std::make_unique(*ortEnv_, wstring.c_str(), - sessionOptions); - + std::filesystem::path unicodeModelPath(modelPath.begin(), + modelPath.end()); + ortSession_ = std::make_unique( + *ortEnv_, unicodeModelPath.c_str(), sessionOptions); #else ortSession_ = std::make_unique(*ortEnv_, modelPath.c_str(), sessionOptions);