Reduce Linux voice capture latency and verify device timing

This commit is contained in:
evgeny committed 2026-10-15 17:26:09 +02:00
1 parent 3276204196
commit 7477da42a5
11 files changed
+342 -38

No files matched your search

+2 -2
View File
@@ -59,8 +59,8 @@ bool CallAudioEngine::openCapture() {
if (!context) return false;
ma_device_config config = ma_device_config_init(ma_device_type_capture);
config.capture.format = ma_format_s16; config.capture.channels = 1; config.sampleRate = CALL_AUDIO_SAMPLE_RATE;
config.periodSizeInMilliseconds = CALL_AUDIO_FRAME_MS;
DEBUG_INFO(DEBUG_CATEGORY_CALL, "CallAudio: capture requested period=%dms; actual period reported by device", CALL_AUDIO_FRAME_MS);
config.periodSizeInMilliseconds = 20; // Прежний запрос для остальных платформ/backends.
AudioDevice::requestLowLatency(context, config);
ma_device_id id;
bool selected = SoundManager::deviceId(m_captureId, &id);
if (selected) config.capture.pDeviceID = &id;