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

Loading…
Cancel
Save