mirror of
https://github.com/qTox/qTox.git
synced 2024-03-22 14:00:36 +08:00
Open the audio in/out devices of the settings
This commit is contained in:
parent
434808cd67
commit
8ff3d1d960
14
src/core.cpp
14
src/core.cpp
|
@ -72,7 +72,11 @@ Core::Core(Camera* cam, QThread *coreThread, QString loadPath) :
|
|||
}
|
||||
|
||||
// OpenAL init
|
||||
alOutDev = alcOpenDevice(nullptr);
|
||||
QString outDevDescr = Settings::getInstance().getOutDev(); ;
|
||||
if (outDevDescr.isEmpty())
|
||||
alOutDev = alcOpenDevice(nullptr);
|
||||
else
|
||||
alOutDev = alcOpenDevice(outDevDescr.toStdString().c_str());
|
||||
if (!alOutDev)
|
||||
{
|
||||
qWarning() << "Core: Cannot open output audio device";
|
||||
|
@ -88,7 +92,13 @@ Core::Core(Camera* cam, QThread *coreThread, QString loadPath) :
|
|||
else
|
||||
alGenSources(1, &alMainSource);
|
||||
}
|
||||
alInDev = alcCaptureOpenDevice(NULL,av_DefaultSettings.audio_sample_rate, AL_FORMAT_MONO16,
|
||||
|
||||
QString inDevDescr = Settings::getInstance().getInDev();
|
||||
if (inDevDescr.isEmpty())
|
||||
alInDev = alcCaptureOpenDevice(nullptr,av_DefaultSettings.audio_sample_rate, AL_FORMAT_MONO16,
|
||||
(av_DefaultSettings.audio_frame_duration * av_DefaultSettings.audio_sample_rate * 4) / 1000);
|
||||
else
|
||||
alInDev = alcCaptureOpenDevice(inDevDescr.toStdString().c_str(),av_DefaultSettings.audio_sample_rate, AL_FORMAT_MONO16,
|
||||
(av_DefaultSettings.audio_frame_duration * av_DefaultSettings.audio_sample_rate * 4) / 1000);
|
||||
if (!alInDev)
|
||||
qWarning() << "Core: Cannot open input audio device";
|
||||
|
|
Loading…
Reference in New Issue
Block a user