diff --git a/deps/NeuralAudio b/deps/NeuralAudio index 15f9f2a..71fdb1e 160000 --- a/deps/NeuralAudio +++ b/deps/NeuralAudio @@ -1 +1 @@ -Subproject commit 15f9f2a78d671cf06881859c17138c383d036e4d +Subproject commit 71fdb1ef29127454299913d29f460ff5518b56df diff --git a/src/nam_plugin.cpp b/src/nam_plugin.cpp index ef53984..6f7014f 100644 --- a/src/nam_plugin.cpp +++ b/src/nam_plugin.cpp @@ -115,31 +115,24 @@ namespace NAM { lv2_log_trace(&nam->logger, "Staging model change: `%s`\n", msg->path); model = NeuralAudio::NeuralModel::CreateFromFile(msg->path); - - // Pre-run model to ensure all needed buffers are allocated in advance - //if (const int32_t numSamples = nam->maxBufferSize) - //{ - // float* buffer = new float[numSamples]; - // memset(buffer, 0, numSamples * sizeof(float)); - - // model->Process(buffer, buffer, numSamples); - // //model->finalize_(numSamples); - - // delete[] buffer; - //} } - response.model = model; + if (model != nullptr) + { + response.model = model; - memcpy(response.path, msg->path, pathlen); + memcpy(response.path, msg->path, pathlen); + } } catch (const std::exception&) + { + } + + if (model == nullptr) { response.path[0] = '\0'; lv2_log_error(&nam->logger, "Unable to load model from: '%s'\n", msg->path); - - //result = LV2_WORKER_ERR_UNKNOWN; } respond(handle, sizeof(response), &response);