Skip to content

Commit eeaa464

Browse files
committed
Update NeuralAudio (add ".aidax" extension")
1 parent 3f5872c commit eeaa464

File tree

2 files changed

+10
-17
lines changed

2 files changed

+10
-17
lines changed

deps/NeuralAudio

src/nam_plugin.cpp

Lines changed: 9 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -115,31 +115,24 @@ namespace NAM {
115115
lv2_log_trace(&nam->logger, "Staging model change: `%s`\n", msg->path);
116116

117117
model = NeuralAudio::NeuralModel::CreateFromFile(msg->path);
118-
119-
// Pre-run model to ensure all needed buffers are allocated in advance
120-
//if (const int32_t numSamples = nam->maxBufferSize)
121-
//{
122-
// float* buffer = new float[numSamples];
123-
// memset(buffer, 0, numSamples * sizeof(float));
124-
125-
// model->Process(buffer, buffer, numSamples);
126-
// //model->finalize_(numSamples);
127-
128-
// delete[] buffer;
129-
//}
130118
}
131119

132-
response.model = model;
120+
if (model != nullptr)
121+
{
122+
response.model = model;
133123

134-
memcpy(response.path, msg->path, pathlen);
124+
memcpy(response.path, msg->path, pathlen);
125+
}
135126
}
136127
catch (const std::exception&)
128+
{
129+
}
130+
131+
if (model == nullptr)
137132
{
138133
response.path[0] = '\0';
139134

140135
lv2_log_error(&nam->logger, "Unable to load model from: '%s'\n", msg->path);
141-
142-
//result = LV2_WORKER_ERR_UNKNOWN;
143136
}
144137

145138
respond(handle, sizeof(response), &response);

0 commit comments

Comments
 (0)