Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- from random import choices, randint, choice
- from pathlib import Path
- from shutil import copy
- from ignore import ignore_list
- import os
- import sys
- root = '/home/liam/Samples/'
- list_of_files = list(Path(root).rglob('*')) # List All Files In ~/Samples
- final_path = "/home/liam/Samples/SpeedComp/Liams_Speedcomp/" # Path To Destination Folder
- audio_file_list = []
- # Delete all files in destination folder when you run the program
- for f in os.listdir(final_path):
- os.remove(os.path.join(final_path, f))
- # Main Loop
- while True:
- audio_file = choice(list_of_files)
- if len(audio_file_list) == 10: # Break loop if you have reached 10 Samples
- break
- else:
- if not any(str(audio_file).startswith(ignore_path) for ignore_path in ignore_list):
- audio_file_list.append(audio_file)
- for x in audio_file_list:
- x = str(x)
- print(x[19:])
- for i in audio_file_list:
- copy(i, final_path)
- # Check length of audio file
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement