From 762b56daa33c9dea6d256692827c0186416cd8c1 Mon Sep 17 00:00:00 2001 From: Luo Jinghua Date: Thu, 16 Apr 2009 15:07:00 +0800 Subject: winmm: shrink audio buffer count to 4. This decrease audio output latency a lot. --- src/device.cpp | 2 +- src/device_mm.cpp | 2 +- src/device_mm.h | 6 +++--- 3 files changed, 5 insertions(+), 5 deletions(-) (limited to 'src') diff --git a/src/device.cpp b/src/device.cpp index 76af8f0..fd0d160 100644 --- a/src/device.cpp +++ b/src/device.cpp @@ -234,7 +234,7 @@ namespace audiere { TRY_GROUP("winmm"); TRY_GROUP("alsa"); TRY_GROUP("oss"); - TRY_GROUP("coreaudio"); + TRY_GROUP("coreaudio"); return 0; } diff --git a/src/device_mm.cpp b/src/device_mm.cpp index e48a126..97c683c 100644 --- a/src/device_mm.cpp +++ b/src/device_mm.cpp @@ -107,7 +107,7 @@ namespace audiere { } } } - Sleep(10); + Sleep(2); } diff --git a/src/device_mm.h b/src/device_mm.h index 2dfa228..ae4f73e 100644 --- a/src/device_mm.h +++ b/src/device_mm.h @@ -26,10 +26,10 @@ namespace audiere { const char* ADR_CALL getName(); private: - // 16 buffers of 1000 frames is 4000 frames at 44100 Hz is about - // 364 milliseconds of audio + // 4 buffers of 1000 frames is 4000 frames at 44100 Hz is about + // 91 milliseconds of audio enum { - BUFFER_COUNT = 16, + BUFFER_COUNT = 4, BUFFER_LENGTH = 1000 * 4, // 1000 samples, 4000 bytes }; -- cgit v1.2.3