This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env C -m | |
#include <stdio.h> | |
#include <stdlib.h> | |
#include <stdint.h> | |
void mix_bytes(const char *in_even_fname, const char *in_odd_fname, int bytes) | |
{ | |
int c; | |
FILE *fin_odd, *fin_even; | |
fin_even = fopen(in_even_fname, "rb"); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env bash | |
# usage: mdout-stream | mplayer - | |
mix-bytes \ | |
<(sox -t coreaudio <LEFT_CHANNEL_AUDIO_IFACE> -t raw -r 16000 -c 1 -b 16 -e signed -L - | modem-rx) \ | |
<(sox -t coreaudio <RIGHT_CHANNEL_AUDIO_IFACE> -t raw -r 16000 -c 1 -b 16 -e signed -L - | modem-rx) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env bash | |
# usage: ./mdin.sh <input-file> <output-file.wav> | |
sox -G -M \ | |
-t raw -r 16000 -c 1 -b 16 -e signed -L <(even-bytes < $1 | modem-tx) \ | |
-t raw -r 16000 -c 1 -b 16 -e signed -L <(odd-bytes < $1 | modem-tx) \ | |
-t wav -r 44100 $2 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env C -m | |
#include <stdio.h> | |
#include <stdlib.h> | |
#include <stdint.h> | |
void odd_bytes(const int bytes) | |
{ | |
int c; | |
do | |
{ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env C -m | |
#include <stdio.h> | |
#include <stdlib.h> | |
#include <stdint.h> | |
void even_bytes(const int bytes) | |
{ | |
int c; | |
do | |
{ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env C -m | |
#include <stdio.h> | |
#include <stdlib.h> | |
#include <stdint.h> | |
void deinterleave(const char *out_even_fname, const char *out_odd_fname, int bytes) | |
{ | |
int c; | |
FILE *fout_odd, *fout_even; | |
fout_odd = fopen(out_odd_fname, "wb"); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Path | |
export PATH="/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin" | |
# Return if non-interactive | |
case $- in | |
*i*) ;; | |
*) return;; | |
esac | |
shopt -s histappend |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env python3 | |
import os | |
import sys | |
import types | |
import struct | |
import itertools | |
import functools | |
import collections |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
--- src/coreaudio.c | |
+++ src/coreaudio.c | |
@@ -152,6 +152,7 @@ static int setup(sox_format_t *ft, int is_input) | |
for (i = 0; i < device_count; i++) | |
{ | |
char name[256]; | |
+ property_size = sizeof(name); | |
status = AudioDeviceGetProperty(devices[i],0,false,kAudioDevicePropertyDeviceName,&property_size,&name); | |
lsx_report("Found Audio Device \"%s\"\n",name); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env bash | |
set -eu | |
SKIP_TRACKS=$((${SKIP_TRACKS:=0} + 1)) | |
while ALBUM="$1" && [ ! -z "$ALBUM" ]; do | |
find "$ALBUM" -iname "*.flac" \ | |
| sed -e 's:\(.*/\)\([^/]*\):\2 \1\2:' \ | |
| sort -n \ | |
| sed -e 's:[^/]* ::' \ |