2#if defined(__linux__) && !defined(__ANDROID__)
7#include "Params/AlsaParams.h"
8#include <alsa/asoundlib.h>
20 class HEPH_API LinuxAudio final :
public NativeAudio
23 using NativeAudio::InitializeRender;
24 using NativeAudio::InitializeCapture;
27 static constexpr long volume_max = INT32_MAX;
32 snd_pcm_t* capturePcm;
38 LinuxAudio(
const LinuxAudio&) =
delete;
39 LinuxAudio& operator=(
const LinuxAudio&) =
delete;
44 void SetMasterVolume(
double volume)
override;
45 double GetMasterVolume()
const override;
46 void InitializeRender(AudioDevice* device, AudioFormatInfo format)
override;
47 void StopRendering()
override;
48 void InitializeCapture(AudioDevice* device, AudioFormatInfo format)
override;
49 void StopCapturing()
override;
50 void GetNativeParams(NativeAudioParams& nativeParams)
const override;
51 void SetNativeParams(
const NativeAudioParams& nativeParams)
override;
54 bool EnumerateAudioDevices()
override;
55 void RenderData(useconds_t bufferDuration_us);
56 void CaptureData(useconds_t bufferDuration_us);
57 snd_pcm_format_t ToPcmFormat(
const AudioFormatInfo& format)
const;
58 snd_pcm_chmap* ToPcmChmap(
const AudioFormatInfo& format)
const;
#define HEPH_API
Definition HephShared.h:132