Skip to content

Instantly share code, notes, and snippets.

@diplojocus
Last active August 29, 2015 14:14
Show Gist options
  • Save diplojocus/9b772f2a5ea25c31059f to your computer and use it in GitHub Desktop.
Save diplojocus/9b772f2a5ea25c31059f to your computer and use it in GitHub Desktop.
Heavy - Print Debugging
#include <stdio.h>
#include "Heavy_heavy.h"
void printHook(double timestampSecs, const char *printLabel, const char *msgString, void *userData) {
printf("[@ %.3f] %s: %s\n", timestampSecs, printLabel, msgString);
}
int main(int argc, const char *argv[]) {
Hv_heavy *context = hv_heavy_new(0, 0, 44100.0);
// set print hook
hv_setPrintHook(context, &printHook);
hv_heavy_process_inline(context, NULL, NULL, 64);
hv_heavy_free(context);
return 0;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment