[AFV] Select audio device based on situational need

For AFV itself, a low latency device is required (which on Windows most likely will pick WASAPI).
For notifications and effects, the most compatible device is required (which on Windows will most likely fall back to QWindowsAudio).
This commit is contained in:
Roland Rossgotterer
2019-10-02 17:09:15 +02:00
committed by Mat Sutcliffe
parent 18ec101391
commit 90e87835fc
5 changed files with 119 additions and 95 deletions

View File

@@ -12,6 +12,9 @@
#define BLACKSOUND_AUDIOUTILITIES_H
#include "blacksound/blacksoundexport.h"
#include "blackmisc/audio/audiodeviceinfo.h"
#include <QAudioDeviceInfo>
#include <QByteArray>
#include <QVector>
@@ -24,6 +27,10 @@ namespace BlackSound
BLACKSOUND_EXPORT QVector<float> convertFromMonoToStereo(const QVector<float> &mono);
BLACKSOUND_EXPORT QVector<qint16> convertFromStereoToMono(const QVector<qint16> &stereo);
BLACKSOUND_EXPORT QVector<float> convertFromShortToFloat(const QVector<qint16> &input);
BLACKSOUND_EXPORT QAudioDeviceInfo getLowestLatencyDevice(const BlackMisc::Audio::CAudioDeviceInfo &device, QAudioFormat &format);
BLACKSOUND_EXPORT QAudioDeviceInfo getHighestCompatibleOutputDevice(const BlackMisc::Audio::CAudioDeviceInfo &device, QAudioFormat &format);
//! @}
} // ns