11#include <sys/asoundlib.h>
37 constexpr std::array sampleRates { 48000, 44100, 22050, 16000, 11025, 8000 };
39 for (
int rate : sampleRates) {
46 if (
info->formats & SND_PCM_FMT_U8) {
51 if (
info->formats & SND_PCM_FMT_S16) {
56 if (
info->formats & SND_PCM_FMT_S32)
59 if (
info->formats & SND_PCM_FMT_FLOAT)
80 const int errorCode = snd_pcm_plugin_params(
handle.get(), &
params);
82 return errorCode == 0;
QAudioFormat preferredFormat
QList< QAudioFormat::SampleFormat > supportedSampleFormats
Mode
Describes the mode of this device.
static QString fromUtf8(QByteArrayView utf8)
This is an overloaded member function, provided for convenience. It differs from the above function o...
bool isFormatSupported(const QAudioFormat &format) const
QnxAudioDeviceInfo(const QByteArray &deviceName, QAudioDevice::Mode mode)
Combined button and popup list for selecting options.
std::optional< snd_pcm_channel_info_t > pcmChannelInfo(snd_pcm_t *handle, QAudioDevice::Mode mode)
HandleUniquePtr openPcmDevice(const QByteArray &id, QAudioDevice::Mode mode)
std::unique_ptr< snd_pcm_t, HandleDeleter > HandleUniquePtr
snd_pcm_channel_params_t formatToChannelParams(const QAudioFormat &format, QAudioDevice::Mode mode, int fragmentSize)
GLuint64 GLenum void * handle
GLint GLsizei GLsizei GLenum format
QFileInfo info(fileName)
[8]