--- /dev/null
+PC := pkg-config
+UCW_CFLAGS := $(shell $(PC) --cflags libucw)
+UCW_LDFLAGS := $(shell $(PC) --libs libucw)
+
+CFLAGS=-std=gnu99 -Wall -Wextra -Wno-parentheses $(UCW_CFLAGS)
+LDFLAGS=$(UCW_LDFLAGS)
+
+all: decode
--- /dev/null
+#include <ucw/lib.h>
+#include <ucw/fastbuf.h>
+#include <ucw/unaligned.h>
+
+#include <stdio.h>
+
+int main(void)
+{
+ struct fastbuf *f = bfdopen_shared(0, 4096);
+
+ byte hdr[48];
+ breadb(f, hdr, sizeof(hdr));
+
+ uint i = 0;
+ int last = -1;
+ uint lasti = 0;
+ for (;;) {
+ byte x[2];
+ if (!bread(f, x, 2))
+ break;
+ int a = (s16) get_u16_le(x);
+ int boo = (a >= 8000);
+ if (boo != last) {
+ if (last >= 0) {
+ uint len = i - lasti;
+#if 0
+ printf("%d\t%d\t%6.3f\n", last, len, (double)len / 44100 * 1000);
+#else
+ if (!last) {
+ if (len > 2000) {
+ putchar('\n');
+ } else if (len >= 26 && len <= 32) {
+ } else {
+ printf("<%d>", len);
+ }
+ } else {
+ if (len >= 18 && len <= 24) {
+ putchar('0');
+ } else if (len >= 68 && len <= 72) {
+ putchar('1');
+ } else if (len >= 194 && len <= 200) {
+ putchar('^');
+ } else {
+ printf("[%d]", len);
+ }
+ }
+#endif
+ }
+ last = boo;
+ lasti = i;
+ }
+ i++;
+ }
+ putchar('\n');
+}