From b5591e08674bd3883f002e2da219834f2d933b20 Mon Sep 17 00:00:00 2001 From: Phil Taylor Date: Mon, 15 Nov 2021 15:26:18 +0000 Subject: [PATCH] Force PA to use 48K Sample Rate if default is 44.1K --- audiohandler.cpp | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/audiohandler.cpp b/audiohandler.cpp index dc35900..4dd623a 100644 --- a/audiohandler.cpp +++ b/audiohandler.cpp @@ -223,10 +223,14 @@ bool audioHandler::init(audioSetup setupIn) aParams.hostApiSpecificStreamInfo = NULL; - // Always use the "preferred" sample rate + // Always use the "preferred" sample rate (unless it is 44100) // We can always resample if needed - this->nativeSampleRate = info->defaultSampleRate; - + if (info->defaultSampleRate == 44100) { + this->nativeSampleRate = 48000; + } + else { + this->nativeSampleRate = info->defaultSampleRate; + } // Per channel chunk size. this->chunkSize = (this->nativeSampleRate / 50);