2 #define _ALSA_OUTPUT_H 1
4 // Extremely minimalistic ALSA output. Will not resample to fit
5 // sound card clock, will not care much about over- or underflows
6 // (so it will not block), will not care about A/V sync.
8 // This means that if you run it for long enough, clocks will
9 // probably drift out of sync enough to make a little pop.
11 #include <alsa/asoundlib.h>
16 ALSAOutput(int sample_rate, int num_channels);
17 void write(const std::vector<float> &samples);
20 snd_pcm_t *pcm_handle;
21 std::vector<float> buffer;
22 snd_pcm_uframes_t period_size;
23 int sample_rate, num_channels;
26 #endif // !defined(_ALSA_OUTPUT_H)