summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorXANTRONIX Development2022-01-31 16:51:52 -0500
committerXANTRONIX Development2022-01-31 16:51:52 -0500
commit09e1154a36f692e9ad2cee5f47fc66459f2568a2 (patch)
tree039da1371b97cd66c1bf7da4a0d094cf7b130d08
parent383ef5610370db5881b102b8906dc2f55fcbf0aa (diff)
downloadxas-09e1154a36f692e9ad2cee5f47fc66459f2568a2.tar.gz
xas-09e1154a36f692e9ad2cee5f47fc66459f2568a2.tar.bz2
xas-09e1154a36f692e9ad2cee5f47fc66459f2568a2.zip
deep sleep
-rw-r--r--include/xas/audio.h6
-rw-r--r--include/xas/mixer.h7
-rw-r--r--src/mixer.c6
3 files changed, 10 insertions, 9 deletions
diff --git a/include/xas/audio.h b/include/xas/audio.h
index 8a7fe4e..76d1e68 100644
--- a/include/xas/audio.h
+++ b/include/xas/audio.h
@@ -4,6 +4,12 @@
#include <stdint.h>
#include <sys/types.h>
+#define XAS_AUDIO_STREAM_PCM_8_BIT 1
+#define XAS_AUDIO_STREAM_PCM_16_BIT 2
+
+#define XAS_AUDIO_STREAM_MONO 1
+#define XAS_AUDIO_STREAM_STEREO 2
+
enum xas_audio_stream_type {
XAS_AUDIO_STREAM_SINK,
XAS_AUDIO_STREAM_SOURCE
diff --git a/include/xas/mixer.h b/include/xas/mixer.h
index 9fd77cb..ca60976 100644
--- a/include/xas/mixer.h
+++ b/include/xas/mixer.h
@@ -25,15 +25,10 @@ typedef struct _xas_mixer {
size_t buffer_size;
} xas_mixer;
-xas_mixer *xas_mixer_new(size_t sample_size,
- size_t sample_rate,
- size_t channels,
- size_t buffer_size);
+xas_mixer *xas_mixer_new(xas_audio_stream *output);
void xas_mixer_destroy(xas_mixer *mixer);
-xas_audio_stream *xas_mixer_output(xas_mixer *mixer);
-
xas_mixer_input *xas_mixer_input_add(xas_mixer *mixer,
xas_audio_stream *stream,
float gain,
diff --git a/src/mixer.c b/src/mixer.c
index da822bf..8007cae 100644
--- a/src/mixer.c
+++ b/src/mixer.c
@@ -34,11 +34,11 @@ static void mixer_apply_int16_t_stereo(int16_t *dest,
static ssize_t mixer_fill(xas_mixer *mixer,
void *samples,
- size_t count,
- xas_audio_stream *output) {
+ size_t count) {
ssize_t ret = 0;
- xas_mixer_input *input = mixer->inputs;
+ xas_mixer_input *input = mixer->inputs,
+ *output = mixer->output;
void (*mixer_apply)(int16_t *,
int16_t *,