feat: run extract before ast
This commit is contained in:
1 parent
154aeebb01
commit
ae32628cdb
1 file changed
+13
@@ -79,6 +79,19 @@ extract:
|
||||
@if [ -x $(PY) ]; then $(PY) extract.py; else python3 extract.py; fi
|
||||
|
||||
ast:
|
||||
@AUDIO_A=$$(python3 -c "import tomllib; c=tomllib.load(open('config.toml','rb')); print(c['extract'].get('file_a',''))" 2>/dev/null); \
|
||||
AUDIO_B=$$(python3 -c "import tomllib; c=tomllib.load(open('config.toml','rb')); print(c['extract'].get('file_b',''))" 2>/dev/null); \
|
||||
OUT=$$(python3 -c "import tomllib; c=tomllib.load(open('config.toml','rb')); print(c['extract'].get('out_dir','extracted'))" 2>/dev/null); \
|
||||
STEM_A=$$(basename "$$AUDIO_A" | sed 's/\.[^.]*$$//'); \
|
||||
STEM_B=$$(basename "$$AUDIO_B" | sed 's/\.[^.]*$$//'); \
|
||||
NEED_EXTRACT=0; \
|
||||
if [ ! -f "$$OUT/$${STEM_A}_audio.wav" ] || [ ! -f "$$OUT/$${STEM_B}_audio.wav" ]; then NEED_EXTRACT=1; fi; \
|
||||
if [ $$NEED_EXTRACT -eq 1 ]; then \
|
||||
echo "=> extracted wavs not found, running make extract first..."; \
|
||||
$(MAKE) extract; \
|
||||
else \
|
||||
echo "=> extracted wavs exist ($$OUT/$${STEM_A}_audio.wav, $$OUT/$${STEM_B}_audio.wav), skipping extract"; \
|
||||
fi
|
||||
@if [ -x $(PY) ]; then $(PY) sync_audio_test.py --config $(CONFIG); else python3 sync_audio_test.py --config $(CONFIG); fi
|
||||
|
||||
clean:
|
||||
|
||||
Reference in new issue
Block a user