Skip to content

Instantly share code, notes, and snippets.

@jonocole
Created May 8, 2011 21:28
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save jonocole/961702 to your computer and use it in GitHub Desktop.
Save jonocole/961702 to your computer and use it in GitHub Desktop.
BackMaskr
#!/bin/bash
if [[ $# == 0 ]]; then
echo $0 [mp3 filename] [header filename]
exit
fi
echo -n 'static char audiodata[] = {' > $2
sox "$1" -t raw -r 8000 -c1 -s -2 - trim 0 10|xxd -i >> $2
echo -n '}; char* fun(){ return audiodata; }' >> $2
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment