added stb, more binaryout changes"
[henge/apc.git] / stb / tests / test_vorbis.c
diff --git a/stb/tests/test_vorbis.c b/stb/tests/test_vorbis.c
new file mode 100644 (file)
index 0000000..341a102
--- /dev/null
@@ -0,0 +1,22 @@
+#define STB_IMAGE_STATIC
+#define STB_IMAGE_IMPLEMENTATION
+#include "stb_image.h"
+
+#define STB_VORBIS_HEADER_ONLY
+#include "stb_vorbis.c"
+#include "stb.h"
+
+extern void stb_vorbis_dumpmem(void);
+
+#ifdef VORBIS_TEST
+int main(int argc, char **argv)
+{
+   size_t memlen;
+   unsigned char *mem = stb_fileu("c:/x/sketch008.ogg", &memlen);
+   int chan, samplerate;
+   short *output;
+   int samples = stb_vorbis_decode_memory(mem, memlen, &chan, &samplerate, &output);
+   stb_filewrite("c:/x/sketch008.raw", output, samples*4);
+   return 0;
+}
+#endif