summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--include/xas/audio.h2
-rw-r--r--src/audio.c6
2 files changed, 8 insertions, 0 deletions
diff --git a/include/xas/audio.h b/include/xas/audio.h
index 4cf3221..d79615d 100644
--- a/include/xas/audio.h
+++ b/include/xas/audio.h
@@ -58,6 +58,8 @@ struct _xas_audio_stream {
void *ctx;
};
+int xas_audio_format_eq(xas_audio_format a, xas_audio_format b);
+
void xas_audio_zero(xas_audio_format format,
void *dest,
size_t index,
diff --git a/src/audio.c b/src/audio.c
index da656f2..bc2e04d 100644
--- a/src/audio.c
+++ b/src/audio.c
@@ -4,6 +4,12 @@
#include <xas/audio.h>
+int xas_audio_format_eq(xas_audio_format a, xas_audio_format b) {
+ return a.channels == b.channels
+ && a.sample_size == b.sample_size
+ && a.sample_rate == b.sample_rate;
+}
+
void xas_audio_copy(xas_audio_format format,
void *dest,
void *src,