kopia lustrzana https://gitlab.com/eliggett/wfview
Use buffered audio for Linux (was just Mac only)
rodzic
ffdcada18c
commit
5b0a3620bd
|
@ -124,14 +124,9 @@ bool audioHandler::init(audioSetup setupIn)
|
||||||
|
|
||||||
if (info.probed)
|
if (info.probed)
|
||||||
{
|
{
|
||||||
// if "preferred" sample rate is 44100, try 48K instead
|
// Always use the "preferred" sample rate
|
||||||
if (info.preferredSampleRate == (unsigned int)44100) {
|
// We can always resample if needed
|
||||||
qDebug(logAudio()) << "Preferred sample rate 44100, trying 48000";
|
|
||||||
this->nativeSampleRate = 48000;
|
|
||||||
}
|
|
||||||
else {
|
|
||||||
this->nativeSampleRate = info.preferredSampleRate;
|
this->nativeSampleRate = info.preferredSampleRate;
|
||||||
}
|
|
||||||
|
|
||||||
// Per channel chunk size.
|
// Per channel chunk size.
|
||||||
this->chunkSize = (this->nativeSampleRate / 50);
|
this->chunkSize = (this->nativeSampleRate / 50);
|
||||||
|
@ -293,7 +288,7 @@ void audioHandler::start()
|
||||||
}
|
}
|
||||||
|
|
||||||
if (setup.isinput) {
|
if (setup.isinput) {
|
||||||
#ifdef Q_OS_MACX
|
#ifndef Q_OS_WIN
|
||||||
this->open(QIODevice::WriteOnly);
|
this->open(QIODevice::WriteOnly);
|
||||||
#else
|
#else
|
||||||
this->open(QIODevice::WriteOnly | QIODevice::Unbuffered);
|
this->open(QIODevice::WriteOnly | QIODevice::Unbuffered);
|
||||||
|
@ -301,7 +296,7 @@ void audioHandler::start()
|
||||||
audioInput->start(this);
|
audioInput->start(this);
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
#ifdef Q_OS_MACX
|
#ifndef Q_OS_WIN
|
||||||
this->open(QIODevice::ReadOnly);
|
this->open(QIODevice::ReadOnly);
|
||||||
#else
|
#else
|
||||||
this->open(QIODevice::ReadOnly | QIODevice::Unbuffered);
|
this->open(QIODevice::ReadOnly | QIODevice::Unbuffered);
|
||||||
|
|
Ładowanie…
Reference in New Issue