From 504b7132e2ecd76220ff8a80868d7594b4dc9bca Mon Sep 17 00:00:00 2001 From: mudler <2420543+mudler@users.noreply.github.com> Date: Sun, 16 Aug 2026 20:26:51 +0000 Subject: [PATCH 1/2] :arrow_up: Update 0xShug0/audio.cpp Signed-off-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com> --- backend/cpp/audio-cpp/Makefile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/backend/cpp/audio-cpp/Makefile b/backend/cpp/audio-cpp/Makefile index 262a95557fde..5e3cf9f128ae 100644 --- a/backend/cpp/audio-cpp/Makefile +++ b/backend/cpp/audio-cpp/Makefile @@ -9,7 +9,7 @@ # recipe is a make target (not a prepare.sh) so 'make purge && make' is a clean # rebuild and so the bump bot can see the pin. -AUDIO_CPP_VERSION?=9d6e7b39236e0151ad28a70fab0d538b84ce8718 +AUDIO_CPP_VERSION?=60a4fea8439a0b254b6ecc6e016d69b6256003cc AUDIO_CPP_REPO?=https://github.com/0xShug0/audio.cpp CURRENT_MAKEFILE_DIR := $(dir $(abspath $(lastword $(MAKEFILE_LIST)))) From 9c7d8f934964db9dde8c0fe075adcadd34d034d0 Mon Sep 17 00:00:00 2001 From: localai-org-maint-bot <306269227+localai-org-maint-bot@users.noreply.github.com> Date: Sun, 16 Aug 2026 23:11:29 +0000 Subject: [PATCH 2/2] fix(audio-cpp): map the MIDI task kind The updated audio.cpp dependency adds MIDI to VoiceTaskKind. Keep the LocalAI mirror complete so the guarded switch compiles. Assisted-by: Codex:gpt-5.4 --- backend/cpp/audio-cpp/capability_routing.cpp | 3 ++- backend/cpp/audio-cpp/capability_routing.h | 5 +++-- backend/cpp/audio-cpp/capability_routing_test.cpp | 2 +- backend/cpp/audio-cpp/loaded_model.cpp | 5 ++++- 4 files changed, 10 insertions(+), 5 deletions(-) diff --git a/backend/cpp/audio-cpp/capability_routing.cpp b/backend/cpp/audio-cpp/capability_routing.cpp index 5fc2b63a7779..7ac6119012c1 100644 --- a/backend/cpp/audio-cpp/capability_routing.cpp +++ b/backend/cpp/audio-cpp/capability_routing.cpp @@ -13,7 +13,7 @@ struct NamedTask { // Short names are exactly the strings audio.cpp prints and parses in // framework/runtime/session.cpp, so a name pinned here survives conversion at // the engine boundary and a name copied out of audio.cpp is accepted here. All -// thirteen have an upstream name; only "spk" is absent from the --task table in +// fourteen have an upstream name; only "spk" is absent from the --task table in // docs/usage.md. const NamedTask kTaskNames[] = { {Task::Vad, "vad"}, @@ -29,6 +29,7 @@ const NamedTask kTaskNames[] = { {Task::VoiceDesign, "vdes"}, {Task::SpeakerRecognition, "spk"}, {Task::Svc, "svc"}, + {Task::Midi, "midi"}, }; // Accepted on input but never emitted. "spkrec" was this backend's own earlier diff --git a/backend/cpp/audio-cpp/capability_routing.h b/backend/cpp/audio-cpp/capability_routing.h index 9ba9c9aca43c..b9766d12b1b1 100644 --- a/backend/cpp/audio-cpp/capability_routing.h +++ b/backend/cpp/audio-cpp/capability_routing.h @@ -25,6 +25,7 @@ enum class Task { VoiceDesign, SpeakerRecognition, Svc, + Midi, }; // Mirrors engine::runtime::RunMode. @@ -77,8 +78,8 @@ struct Route { Route resolve_route(Rpc rpc, const RequestShape &shape, const Capabilities &caps); // Canonical audio.cpp short names: gen, tts, clon, vc, svc, s2s, asr, align, -// vad, diar, sep, vdes, spk. parse_task_name additionally accepts "spkrec" as -// a legacy alias; task_name only ever emits "spk". +// vad, diar, sep, vdes, spk, midi. parse_task_name additionally accepts +// "spkrec" as a legacy alias; task_name only ever emits "spk". const char *task_name(Task task); const char *mode_name(Mode mode); const char *rpc_name(Rpc rpc); diff --git a/backend/cpp/audio-cpp/capability_routing_test.cpp b/backend/cpp/audio-cpp/capability_routing_test.cpp index b4f44e289b0e..9163d4ba3c3a 100644 --- a/backend/cpp/audio-cpp/capability_routing_test.cpp +++ b/backend/cpp/audio-cpp/capability_routing_test.cpp @@ -361,7 +361,7 @@ static void test_names_round_trip() { Task::SourceSeparation, Task::AudioGeneration, Task::Tts, Task::VoiceCloning, Task::VoiceConversion, Task::SpeechToSpeech, Task::Alignment, Task::VoiceDesign, - Task::SpeakerRecognition, Task::Svc}; + Task::SpeakerRecognition, Task::Svc, Task::Midi}; for (const Task t : all) { Task parsed = Task::Vad; const bool ok = parse_task_name(task_name(t), parsed); diff --git a/backend/cpp/audio-cpp/loaded_model.cpp b/backend/cpp/audio-cpp/loaded_model.cpp index 779a19ab61de..154d65d4608e 100644 --- a/backend/cpp/audio-cpp/loaded_model.cpp +++ b/backend/cpp/audio-cpp/loaded_model.cpp @@ -69,7 +69,7 @@ static_assert(kEngine(engine::runtime::VoiceTaskKind::VoiceDesign) == 10, "Voice static_assert(kEngine(engine::runtime::VoiceTaskKind::SpeakerRecognition) == 11, "VoiceTaskKind drifted"); // The last member. Pinning it pins the member count too, as long as the // enumerators stay contiguous and unassigned, which upstream's declaration is. -static_assert(kEngine(engine::runtime::VoiceTaskKind::Svc) == 12, +static_assert(kEngine(engine::runtime::VoiceTaskKind::Midi) == 13, "engine::runtime::VoiceTaskKind gained, lost or reordered a member. " "audiocpp_backend::Task mirrors it positionally: update capability_routing.h, " "to_engine_task and from_engine_task together, then move this pin."); @@ -87,6 +87,7 @@ static_assert(kMirror(Task::Alignment) == 9, "Task drifted from VoiceTaskKind"); static_assert(kMirror(Task::VoiceDesign) == 10, "Task drifted from VoiceTaskKind"); static_assert(kMirror(Task::SpeakerRecognition) == 11, "Task drifted from VoiceTaskKind"); static_assert(kMirror(Task::Svc) == 12, "Task drifted from VoiceTaskKind"); +static_assert(kMirror(Task::Midi) == 13, "Task drifted from VoiceTaskKind"); static_assert(static_cast(engine::runtime::RunMode::Offline) == 0, "RunMode drifted"); static_assert(static_cast(engine::runtime::RunMode::Streaming) == 1, @@ -241,6 +242,7 @@ engine::runtime::VoiceTaskKind to_engine_task(Task task) { case Task::VoiceDesign: return K::VoiceDesign; case Task::SpeakerRecognition: return K::SpeakerRecognition; case Task::Svc: return K::Svc; + case Task::Midi: return K::Midi; } // Unreachable for any valid enumerator. No `default:` label, so -Wswitch // still reports a member this switch stops covering. @@ -263,6 +265,7 @@ Task from_engine_task(engine::runtime::VoiceTaskKind kind) { case K::VoiceDesign: return Task::VoiceDesign; case K::SpeakerRecognition: return Task::SpeakerRecognition; case K::Svc: return Task::Svc; + case K::Midi: return Task::Midi; } return Task::Vad; }