From 4058194b18b0bda486dbcc4aa5b01931a212eecd Mon Sep 17 00:00:00 2001 From: "mudler's LocalAI [bot]" <139863280+localai-bot@users.noreply.github.com> Date: Tue, 18 Aug 2026 09:46:56 +0200 Subject: [PATCH] chore: :arrow_up: Update 0xShug0/audio.cpp to `3407559d7c83b543bd60ca8fa2b630374e71083f` (#11474) * :arrow_up: Update 0xShug0/audio.cpp Signed-off-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com> * fix(audio-cpp): map the MIDI task audio.cpp now appends MIDI to its task enum. Keep the LocalAI mirror and conversion switches aligned so the backend builds against the new pin. Assisted-by: Codex:gpt-5 --------- Signed-off-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com> Co-authored-by: mudler <2420543+mudler@users.noreply.github.com> Co-authored-by: localai-org-maint-bot <306269227+localai-org-maint-bot@users.noreply.github.com> --- backend/cpp/audio-cpp/Makefile | 2 +- backend/cpp/audio-cpp/capability_routing.cpp | 1 + backend/cpp/audio-cpp/capability_routing.h | 1 + backend/cpp/audio-cpp/capability_routing_test.cpp | 2 +- backend/cpp/audio-cpp/loaded_model.cpp | 6 +++++- 5 files changed, 9 insertions(+), 3 deletions(-) diff --git a/backend/cpp/audio-cpp/Makefile b/backend/cpp/audio-cpp/Makefile index 262a95557..6dd5d2d1e 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?=3407559d7c83b543bd60ca8fa2b630374e71083f AUDIO_CPP_REPO?=https://github.com/0xShug0/audio.cpp CURRENT_MAKEFILE_DIR := $(dir $(abspath $(lastword $(MAKEFILE_LIST)))) diff --git a/backend/cpp/audio-cpp/capability_routing.cpp b/backend/cpp/audio-cpp/capability_routing.cpp index 5fc2b63a7..9cd5b9b32 100644 --- a/backend/cpp/audio-cpp/capability_routing.cpp +++ b/backend/cpp/audio-cpp/capability_routing.cpp @@ -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 9ba9c9aca..6b0a9098b 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. diff --git a/backend/cpp/audio-cpp/capability_routing_test.cpp b/backend/cpp/audio-cpp/capability_routing_test.cpp index b4f44e289..9163d4ba3 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 779a19ab6..77dc10442 100644 --- a/backend/cpp/audio-cpp/loaded_model.cpp +++ b/backend/cpp/audio-cpp/loaded_model.cpp @@ -69,7 +69,8 @@ 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::Svc) == 12, "VoiceTaskKind drifted"); +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 +88,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 +243,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 +266,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; }