|
From: Tapio V. <aa...@us...> - 2010-08-21 14:02:44
|
Module: performous
Branch: joinmenu
Commit: 9cd1bf961dac4b8ec59dd8445eebb05a73655ec3
Author: Tapio Vierros <tap...@gm...>
Date: Thu Aug 19 17:29:07 2010 +0300
Make suggestedLatency configurable.
---
data/schema.xml | 8 ++++++++
game/audio.cc | 3 ++-
2 files changed, 10 insertions(+), 1 deletions(-)
diff --git a/data/schema.xml b/data/schema.xml
index 6f7650f..bd0152a 100644
--- a/data/schema.xml
+++ b/data/schema.xml
@@ -161,6 +161,14 @@ to save the current settings to XML.
</entry>
<!-- Audio preferences -->
+ <entry name="audio/latency" type="float" value="0.05">
+ <ui unit=" ms" multiplier="1000" />
+ <limits min="0.0" max="0.25" step="0.005" />
+ <locale name="C">
+ <short>Suggested latency</short>
+ <long>This is a hint for the audio engine about the desired latency. Set this as low as possible while retaining clear audio playback. Requires restart.</long>
+ </locale>
+ </entry>
<entry name="audio/video_delay" type="float" value="0.06">
<ui unit=" ms" multiplier="1000" />
<limits min="-0.5" max="0.5" step="0.01" />
diff --git a/game/audio.cc b/game/audio.cc
index f86e728..9bae54f 100644
--- a/game/audio.cc
+++ b/game/audio.cc
@@ -325,7 +325,8 @@ struct Device {
Device(unsigned int in, unsigned int out, double rate, unsigned int dev):
in(in), out(out), rate(rate), dev(dev),
- stream(*this, in ? portaudio::Params().channelCount(in).device(dev) : (const PaStreamParameters*)NULL, (out ? portaudio::Params().channelCount(out).device(dev) : (const PaStreamParameters*)NULL), rate),
+ stream(*this, in ? portaudio::Params().channelCount(in).device(dev).suggestedLatency(config["audio/latency"].f()): (const PaStreamParameters*)NULL,
+ (out ? portaudio::Params().channelCount(out).device(dev).suggestedLatency(config["audio/latency"].f()) : (const PaStreamParameters*)NULL), rate),
outptr()
{
mics.resize(in);
|