diff options
author | Lasse Flygenring-Harrsen <Lasse@Flygenring-Harrsen.com> | 2020-07-09 00:42:03 +0200 |
---|---|---|
committer | Lasse Flygenring-Harrsen <Lasse@Flygenring-Harrsen.com> | 2020-07-09 00:42:03 +0200 |
commit | 6d2fa862858dafdea29fc2e4a3dc39c3dbb17f2e (patch) | |
tree | b03c3dc5c5c08129ed7f0642dd3e64d75aa866e0 /input/common.h |
Import Upstream version 0.7.1
Diffstat (limited to 'input/common.h')
-rw-r--r-- | input/common.h | 36 |
1 files changed, 36 insertions, 0 deletions
diff --git a/input/common.h b/input/common.h new file mode 100644 index 0000000..3737f2b --- /dev/null +++ b/input/common.h @@ -0,0 +1,36 @@ +#pragma once + +#include <assert.h> +#include <errno.h> +#include <fcntl.h> +#include <inttypes.h> +#include <pthread.h> +#include <stdbool.h> +#include <stdio.h> +#include <stdlib.h> +#include <string.h> +#include <unistd.h> + +struct audio_data { + int FFTbassbufferSize; + int FFTmidbufferSize; + int FFTtreblebufferSize; + int bass_index; + int mid_index; + int treble_index; + double *in_bass_r, *in_bass_l; + double *in_mid_r, *in_mid_l; + double *in_treble_r, *in_treble_l; + int format; + unsigned int rate; + char *source; // alsa device, fifo path or pulse source + int im; // input mode alsa, fifo or pulse + unsigned int channels; + bool left, right, average; + int terminate; // shared variable used to terminate audio thread + char error_message[1024]; +}; + +void reset_output_buffers(struct audio_data *data); + +int write_to_fftw_input_buffers(int16_t buf[], int16_t frames, void *data); |