Skip to content

Commit 5071456

Browse files
committed
Use default latencies
1 parent 220d66c commit 5071456

File tree

1 file changed

+2
-3
lines changed

1 file changed

+2
-3
lines changed

src/core/audio/AudioPortAudio.cpp

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -126,19 +126,18 @@ AudioPortAudio::AudioPortAudio(bool& successful, AudioEngine* engine)
126126

127127
const auto sampleRate = engine->baseSampleRate();
128128
const auto framesPerBuffer = engine->framesPerPeriod();
129-
const auto latency = static_cast<PaTime>(framesPerBuffer) / sampleRate;
130129

131130
auto inputParameters = PaStreamParameters{.device = inputDeviceIndex,
132131
.channelCount = inputDeviceChannels,
133132
.sampleFormat = paFloat32,
134-
.suggestedLatency = latency,
133+
.suggestedLatency = Pa_GetDeviceInfo(outputDeviceIndex)->defaultLowInputLatency,
135134
.hostApiSpecificStreamInfo = nullptr
136135
};
137136

138137
auto outputParameters = PaStreamParameters{.device = outputDeviceIndex,
139138
.channelCount = outputDeviceChannels,
140139
.sampleFormat = paFloat32,
141-
.suggestedLatency = latency,
140+
.suggestedLatency = Pa_GetDeviceInfo(outputDeviceIndex)->defaultLowOutputLatency,
142141
.hostApiSpecificStreamInfo = nullptr
143142
};
144143

0 commit comments

Comments
 (0)