summaryrefslogtreecommitdiff
path: root/thirdparty/stb/tests/test_vorbis.c
diff options
context:
space:
mode:
authorFluorescentCIAAfricanAmerican <[email protected]>2020-04-22 12:56:21 -0400
committerFluorescentCIAAfricanAmerican <[email protected]>2020-04-22 12:56:21 -0400
commit3bf9df6b2785fa6d951086978a3e66f49427166a (patch)
tree2c0f1f0c63c4832882bc93814ebd2c2b1c6224e5 /thirdparty/stb/tests/test_vorbis.c
downloadarchived-source-engine-2018-hl2-src-master.tar.xz
archived-source-engine-2018-hl2-src-master.zip
Diffstat (limited to 'thirdparty/stb/tests/test_vorbis.c')
-rw-r--r--thirdparty/stb/tests/test_vorbis.c22
1 files changed, 22 insertions, 0 deletions
diff --git a/thirdparty/stb/tests/test_vorbis.c b/thirdparty/stb/tests/test_vorbis.c
new file mode 100644
index 0000000..341a102
--- /dev/null
+++ b/thirdparty/stb/tests/test_vorbis.c
@@ -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