diff --git a/src/FileIO/GenerateAudioModel.cpp b/src/FileIO/GenerateAudioModel.cpp index cdd43be..c110a18 100644 --- a/src/FileIO/GenerateAudioModel.cpp +++ b/src/FileIO/GenerateAudioModel.cpp @@ -35,6 +35,11 @@ GenerateAudioModel::GenerateAudioModel(std::filesystem::path path, lessConfigure GenerateModelFromFile(); } +GenerateAudioModel::GenerateAudioModel(char *path, lessConfigure configure) : configure(std::move(configure)) { + auto file_path = std::string(path); + WavFileModel(file_path); +} + void GenerateAudioModel::PrintWavFiles() { for (const auto &file: wav_files) { YALL_DEBUG_ << file.string(); @@ -117,3 +122,4 @@ template void GenerateAudioModel::for_each(I begin, I end, F f) { for_each(std::thread::hardware_concurrency(), begin, end, f); } + diff --git a/src/FileIO/GenerateAudioModel.h b/src/FileIO/GenerateAudioModel.h index 9954ef6..d1f9e6d 100644 --- a/src/FileIO/GenerateAudioModel.h +++ b/src/FileIO/GenerateAudioModel.h @@ -23,6 +23,7 @@ class GenerateAudioModel { public: GenerateAudioModel(std::filesystem::path path, lessConfigure configure); + GenerateAudioModel(char *path, lessConfigure configure); void PrintWavFiles(); diff --git a/src/lessampler.cpp b/src/lessampler.cpp index b3e1d02..4d921d2 100644 --- a/src/lessampler.cpp +++ b/src/lessampler.cpp @@ -58,14 +58,14 @@ void lessampler::run() { // In some projects, the creator will use x.wav, z.wav or other non-existing audio to force truncation of audio // here is a basic handle。 - if (!std::filesystem::exists(in_file_path)){ + if (!std::filesystem::exists(in_file_path)) { return; } // Check if an audio model exists。 If it does not exist, turn on multithreaded generation if (!audio_model_io.CheckAudioModel()) { YALL_INFO_ << "Audio model: " + in_file_path.string() + " not found, generating..."; - GenerateAudioModel genmodule(std::filesystem::weakly_canonical(std::filesystem::path(argv[1])).parent_path(), configure); + GenerateAudioModel genmodule(argv[1], configure); } // Read audio model @@ -107,7 +107,7 @@ bool lessampler::ParseArgs() { show_logo(); Dialogs::notify("lessampler", "Start modeling against the audio files"); YALL_INFO_ << "Start modeling against the audio files in the provided destination folder..."; - GenerateAudioModel genmodule(argv[1], configure); + GenerateAudioModel genmodule(std::filesystem::path(argv[1]), configure); return false; }