From a15e838df6a8f012b50c5ff60b641716e34df934 Mon Sep 17 00:00:00 2001 From: c vw Date: Sun, 23 May 2021 10:39:52 +0200 Subject: [PATCH] adapted for using pulseaudio --- receiver.h | 21 +++++++++++++++++---- 1 file changed, 17 insertions(+), 4 deletions(-) diff --git a/receiver.h b/receiver.h index 11af7fc..1fc1057 100644 --- a/receiver.h +++ b/receiver.h @@ -22,9 +22,14 @@ #include #ifdef PORTAUDIO #include "portaudio.h" -#else +#endif +#ifdef ALSA #include #endif +#ifdef PULSEAUDIO +#include +#include +#endif enum _audio_t { STEREO=0, @@ -120,14 +125,22 @@ typedef struct _receiver { PaStream *playback_handle; gint local_audio_buffer_inpt; // pointer in audio ring-buffer gint local_audio_buffer_outpt; // pointer in audio ring-buffer -#else + float *local_audio_buffer; + gint local_audio_cw; // flag for latency switching +#endif +#ifdef ALSA snd_pcm_t *playback_handle; snd_pcm_format_t local_audio_format; -#endif + void *local_audio_buffer; // different formats possible, so void* gint local_audio_cw; // flag for latency switching +#endif +#ifdef PULSEAUDIO + pa_simple *playstream; + gboolean output_started; + float *local_audio_buffer; +#endif gint local_audio_buffer_size; gint local_audio_buffer_offset; - void *local_audio_buffer; GMutex local_audio_mutex; gint low_latency; -- 2.45.2