aboutsummaryrefslogtreecommitdiffstats
path: root/Alc/converter.h
diff options
context:
space:
mode:
Diffstat (limited to 'Alc/converter.h')
-rw-r--r--Alc/converter.h42
1 files changed, 42 insertions, 0 deletions
diff --git a/Alc/converter.h b/Alc/converter.h
new file mode 100644
index 00000000..76b2520f
--- /dev/null
+++ b/Alc/converter.h
@@ -0,0 +1,42 @@
+#ifndef CONVERTER_H
+#define CONVERTER_H
+
+#include "alMain.h"
+#include "alu.h"
+
+#ifdef __cpluspluc
+extern "C" {
+#endif
+
+typedef struct SampleConverter {
+ enum DevFmtType mSrcType;
+ enum DevFmtType mDstType;
+ ALsizei mNumChannels;
+ ALsizei mSrcTypeSize;
+ ALsizei mDstTypeSize;
+
+ ALint mSrcPrepCount;
+
+ ALsizei mFracOffset;
+ ALsizei mIncrement;
+ ResamplerFunc mResample;
+
+ alignas(16) ALfloat mSrcSamples[BUFFERSIZE+MAX_PRE_SAMPLES+MAX_POST_SAMPLES];
+ alignas(16) ALfloat mDstSamples[BUFFERSIZE];
+
+ struct {
+ alignas(16) ALfloat mPrevSamples[MAX_PRE_SAMPLES+MAX_POST_SAMPLES];
+ } Chan[];
+} SampleConverter;
+
+SampleConverter *CreateSampleConverter(enum DevFmtType srcType, enum DevFmtType dstType, ALsizei numchans, ALsizei srcRate, ALsizei dstRate);
+void DestroySampleConverter(SampleConverter **converter);
+
+ALsizei SampleConverterInput(SampleConverter *converter, const ALvoid *src, ALsizei *srcframes, ALvoid *dst, ALsizei dstframes);
+ALsizei SampleConverterAvailableOut(SampleConverter *converter, ALsizei srcframes);
+
+#ifdef __cpluspluc
+}
+#endif
+
+#endif /* CONVERTER_H */