Browse Source

update to add run task

master
wes 7 years ago
parent
commit
47b43678dc
  1. 5
      Makefile
  2. 2
      README.md
  3. 20
      slice.py

5
Makefile

@ -0,0 +1,5 @@
default:
virtualenv venv && source venv/bin/activate && pip install -r requirements.txt
run:
source venv/bin/activate && ./slice.py ${DIR}

2
README.md

@ -0,0 +1,2 @@
run `make` to install it, then do `make DIR=/wherever/your/files/are/ run` to
run it

20
slice.py

@ -48,14 +48,16 @@ def silence(infile):
convert(infile)
def silence_all():
local("mkdir -p ./shortened")
fileset = local("ls .", capture=True).split("\n")
shuffle(fileset)
for f in fileset:
if f.split(".")[-1] in ["ogg", "opus", "m4a", "mp3"]:
try:
silence(f)
except Exception:
pass
with lcd(argv[1]):
local("mkdir -p ./shortened")
fileset = local("ls .", capture=True).split("\n")
shuffle(fileset)
for f in fileset:
if f.split(".")[-1] in ["ogg", "opus", "m4a", "mp3"]:
try:
silence(f)
local("rm -f /tmp/*wav")
except Exception:
pass
silence_all()

Loading…
Cancel
Save