-
Notifications
You must be signed in to change notification settings - Fork 1
Chore/clean saving folder #1
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM!
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pull Request Overview
Refactors how audio segments are saved by centralizing and timestamping output directories, and removes redundant package entries.
- Imports
time
to generate timestamped folders. - Moves
segments/
root folder creation to module scope. - Creates nested timestamped and per-file directories for segmented audio and updates
split_audio
target path.
Comments suppressed due to low confidence (1)
app.py:41
- [nitpick] Using
output_wav_name
(which includes the.wav
extension) for a directory name can be confusing. Consider using the stem (e.g.,Path(output_wav_name).stem
) so the folder name doesn’t include the file extension.
segment_audios_folder = current_time_segment_folder / output_wav_name
os.makedirs(current_time_segment_folder, exist_ok=True) | ||
|
||
# Create folder for segmented audios. | ||
segment_audios_folder = current_time_segment_folder / output_wav_name | ||
os.makedirs(segment_audios_folder, exist_ok=True) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
For consistency with the rest of the codebase using pathlib.Path
, you could replace os.makedirs(...)
with current_time_segment_folder.mkdir(exist_ok=True, parents=true)
.
os.makedirs(current_time_segment_folder, exist_ok=True) | |
# Create folder for segmented audios. | |
segment_audios_folder = current_time_segment_folder / output_wav_name | |
os.makedirs(segment_audios_folder, exist_ok=True) | |
current_time_segment_folder.mkdir(exist_ok=True, parents=True) | |
# Create folder for segmented audios. | |
segment_audios_folder = current_time_segment_folder / output_wav_name | |
segment_audios_folder.mkdir(exist_ok=True, parents=True) |
Copilot uses AI. Check for mistakes.
requirements.txt