text grid integration; temp file management

This commit is contained in:
Jason
2022-04-03 11:25:18 -07:00
parent 906d649a39
commit ca26e3f058
5 changed files with 42 additions and 29 deletions
+8 -1
View File
@@ -25,6 +25,8 @@ import wave
import tempfile
import os
from isort import file
def csv_append_row(tmp_preds, preds_filename, with_headers=True):
@@ -55,7 +57,7 @@ def csv_append_row(tmp_preds, preds_filename, with_headers=True):
def generate_tmp_filename(extension):
return tempfile._get_default_tempdir() + "/" + next(tempfile._get_candidate_names()) + "." + extension
return "temp/" + next(tempfile._get_candidate_names()) + "." + extension
def logging_defaults(logging_level="INFO"):
@@ -169,3 +171,8 @@ def is_valid_wav(filename):
or wav_file.getcomptype() != 'NONE':
return False
return True
def delete_temp_files():
print("Clearing temp files...")
for filename in os.listdir("temp"):
os.remove("temp/" + filename)