In slice_audio.py save output chunks files into a txt file
Browse files- slice_audio.py +8 -0
slice_audio.py
CHANGED
@@ -39,6 +39,7 @@ def main(args):
|
|
39 |
|
40 |
# Slice audio into SECONDS chunks
|
41 |
hour, minute, second = seconds_to_hms(SECONDS) # Duration of each chunk
|
|
|
42 |
for chunk in range(num_chunks):
|
43 |
start_time = chunk * SECONDS
|
44 |
hour_start, minute_start, second_start = seconds_to_hms(start_time) # Start time of each chunk
|
@@ -57,6 +58,13 @@ def main(args):
|
|
57 |
print(command)
|
58 |
os.system(command)
|
59 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
60 |
if __name__ == "__main__":
|
61 |
argparser = argparse.ArgumentParser(description='Slice audio into smaller chunks')
|
62 |
argparser.add_argument('input', help='Input audio file')
|
|
|
39 |
|
40 |
# Slice audio into SECONDS chunks
|
41 |
hour, minute, second = seconds_to_hms(SECONDS) # Duration of each chunk
|
42 |
+
output_files = []
|
43 |
for chunk in range(num_chunks):
|
44 |
start_time = chunk * SECONDS
|
45 |
hour_start, minute_start, second_start = seconds_to_hms(start_time) # Start time of each chunk
|
|
|
58 |
print(command)
|
59 |
os.system(command)
|
60 |
|
61 |
+
output_files.append(output)
|
62 |
+
|
63 |
+
# write output files to a txt file
|
64 |
+
with open(f"{FOLDER}/output_files.txt", "w") as f:
|
65 |
+
for output_file in output_files:
|
66 |
+
f.write(f"{output_file}\n")
|
67 |
+
|
68 |
if __name__ == "__main__":
|
69 |
argparser = argparse.ArgumentParser(description='Slice audio into smaller chunks')
|
70 |
argparser.add_argument('input', help='Input audio file')
|