diff options
| -rwxr-xr-x | datasets/dataset.pl | 4 | ||||
| -rwxr-xr-x | get.pl | 17 | ||||
| -rwxr-xr-x | mix.sh | 5 | ||||
| -rwxr-xr-x | results/xfade.sh | 2 | ||||
| -rw-r--r-- | upload.js | 11 |
5 files changed, 32 insertions, 7 deletions
diff --git a/datasets/dataset.pl b/datasets/dataset.pl index 8b77af9..edde43f 100755 --- a/datasets/dataset.pl +++ b/datasets/dataset.pl @@ -48,7 +48,7 @@ sub process($) { my $a_tmp = "a_" . $filename; my $b_tmp = "b_" . $filename; - if ($opt_c) { + if (!$opt_c) { print "Normalizing..."; system("sox", "-v", 0.945, $filename, $a_tmp); } else { @@ -56,7 +56,7 @@ sub process($) { } system("./spread.sh", $a_tmp, $b_tmp, 0.999, $scale, 1.001); system("./split44k.sh", $b_tmp, 8, $name); - if ($opt_c) { + if (!$opt_c) { system("/bin/rm", $a_tmp); } system("/bin/rm", $b_tmp); @@ -0,0 +1,17 @@ +#!/usr/bin/perl + +$SIG{TERM} = $SIG{INT} = sub { exit 1 }; + +chdir('datasets'); + +foreach (@ARGV){ + my $s = $_; + if ($s !~/\..*$/) { $s .= ".wav"; } + system('/usr/bin/wget', 'https://neural:spawn5@asdf.us/neural/' . $s); + system('/usr/bin/perl', 'dataset.pl', $s); +} + +END { + chdir('..'); +} + @@ -14,9 +14,8 @@ echo "rendering $name" cd "$dir/samples" mkdir "$name" ../../xfade.sh -sox mix.wav norm.wav norm -lame -V 0 norm.wav "../../../output/$name.mp3" -rm mix.wav norm.wav +lame -V 0 mix.wav "../../../output/$name.mp3" +rm mix.wav mv *.wav "$name" cd .. grep valid log diff --git a/results/xfade.sh b/results/xfade.sh index 0a5e34a..55d343d 100755 --- a/results/xfade.sh +++ b/results/xfade.sh @@ -12,7 +12,7 @@ do if [ $i -eq 1 ] then - cp $file mix.wav + sox $file mix.wav highpass 10 else # ../../crossfade_cat.sh $crossfade_dur mix.wav $file yes yes # echo $file @@ -1,5 +1,7 @@ #!`which node` +const { execFile } = require('child_process'); + require('dotenv').load(); var request = require('request') var path = require('path') @@ -32,7 +34,14 @@ var r = request.post('https://bucky.asdf.us/api/thread/' + id + '/comment', func console.log('\n') argv['_'].forEach(fn => { const partz = fn.split('/') - console.log('https://s3.amazonaws.com/i.asdf.us/bucky/data/' + id + '/' + partz[partz.length-1]); + const url = 'https://s3.amazonaws.com/i.asdf.us/bucky/data/' + id + '/' + partz[partz.length-1] + console.log(url) + const child = execFile('slack', ['chat', 'send', url, '#ai'], (error, stdout, stderr) => { + if (error) { + throw error; + } + console.log(stdout); + }); }) }) |
