Add audio capture engine template system with multi-backend support

Introduces an engine+template abstraction for audio capture, mirroring the
existing screen capture engine pattern. This enables multiple audio backends
(WASAPI for Windows, sounddevice for cross-platform) with per-source
engine configuration via reusable templates.

Backend:
- AudioCaptureEngine ABC with WasapiEngine and SounddeviceEngine implementations
- AudioEngineRegistry for engine discovery and factory creation
- AudioAnalyzer class decouples FFT/RMS/beat analysis from engine-specific capture
- ManagedAudioStream wraps engine stream + analyzer in background thread
- AudioCaptureTemplate model and AudioTemplateStore with JSON CRUD
- AudioCaptureManager keyed by (engine_type, device_index, is_loopback)
- Auto-migration: default template created on startup, assigned to existing sources
- Full REST API: CRUD for audio templates + engine listing with availability flags
- audio_template_id added to MultichannelAudioSource model and API schemas

Frontend:
- Audio template cards in Streams > Audio tab with engine badge and config details
- Audio template editor modal with engine selector and dynamic config fields
- Audio template dropdown in multichannel audio source editor
- Template name crosslink badge on multichannel audio source cards
- Confirm modal z-index fix (always stacks above editor modals)
- i18n keys for EN and RU

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
2026-02-26 13:55:46 +03:00
parent cbbaa852ed
commit bae2166bc2
35 changed files with 2163 additions and 402 deletions

View File

@@ -789,6 +789,30 @@
"audio_source.deleted": "Audio source deleted",
"audio_source.delete.confirm": "Are you sure you want to delete this audio source?",
"audio_source.error.name_required": "Please enter a name",
"audio_source.audio_template": "Audio Template:",
"audio_source.audio_template.hint": "Audio capture template that defines which engine and settings to use for this device",
"audio_template.title": "🎵 Audio Templates",
"audio_template.add": "Add Audio Template",
"audio_template.edit": "Edit Audio Template",
"audio_template.name": "Template Name:",
"audio_template.name.placeholder": "My Audio Template",
"audio_template.description.label": "Description (optional):",
"audio_template.description.placeholder": "Describe this template...",
"audio_template.engine": "Audio Engine:",
"audio_template.engine.hint": "Select the audio capture backend to use. WASAPI is Windows-only with loopback support. Sounddevice is cross-platform.",
"audio_template.engine.unavailable": "Unavailable",
"audio_template.engine.unavailable.hint": "This engine is not available on your system",
"audio_template.config": "Configuration",
"audio_template.config.show": "Show configuration",
"audio_template.created": "Audio template created",
"audio_template.updated": "Audio template updated",
"audio_template.deleted": "Audio template deleted",
"audio_template.delete.confirm": "Are you sure you want to delete this audio template?",
"audio_template.error.load": "Failed to load audio templates",
"audio_template.error.engines": "Failed to load audio engines",
"audio_template.error.required": "Please fill in all required fields",
"audio_template.error.delete": "Failed to delete audio template",
"streams.group.value": "Value Sources",
"value_source.group.title": "🔢 Value Sources",

View File

@@ -789,6 +789,30 @@
"audio_source.deleted": "Аудиоисточник удалён",
"audio_source.delete.confirm": "Удалить этот аудиоисточник?",
"audio_source.error.name_required": "Введите название",
"audio_source.audio_template": "Аудиошаблон:",
"audio_source.audio_template.hint": "Шаблон аудиозахвата определяет, какой движок и настройки использовать для этого устройства",
"audio_template.title": "🎵 Аудиошаблоны",
"audio_template.add": "Добавить аудиошаблон",
"audio_template.edit": "Редактировать аудиошаблон",
"audio_template.name": "Название шаблона:",
"audio_template.name.placeholder": "Мой аудиошаблон",
"audio_template.description.label": "Описание (необязательно):",
"audio_template.description.placeholder": "Опишите этот шаблон...",
"audio_template.engine": "Аудиодвижок:",
"audio_template.engine.hint": "Выберите движок аудиозахвата. WASAPI — только Windows с поддержкой loopback. Sounddevice — кроссплатформенный.",
"audio_template.engine.unavailable": "Недоступен",
"audio_template.engine.unavailable.hint": "Этот движок недоступен в вашей системе",
"audio_template.config": "Конфигурация",
"audio_template.config.show": "Показать конфигурацию",
"audio_template.created": "Аудиошаблон создан",
"audio_template.updated": "Аудиошаблон обновлён",
"audio_template.deleted": "Аудиошаблон удалён",
"audio_template.delete.confirm": "Удалить этот аудиошаблон?",
"audio_template.error.load": "Не удалось загрузить аудиошаблоны",
"audio_template.error.engines": "Не удалось загрузить аудиодвижки",
"audio_template.error.required": "Пожалуйста, заполните все обязательные поля",
"audio_template.error.delete": "Не удалось удалить аудиошаблон",
"streams.group.value": "Источники значений",
"value_source.group.title": "🔢 Источники значений",