Skip to content

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

Open
wants to merge 3 commits into
base: main
Choose a base branch
from
Open

Conversation

kimmchii
Copy link
Collaborator

@kimmchii kimmchii commented Feb 3, 2025

  • make it more readability when saving audio snippets
  • remove some builtin packages in requirements.txt

@kimmchii kimmchii requested a review from titipata February 3, 2025 13:32
Copy link
Collaborator

@titipata titipata left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM!

@bluenex bluenex requested a review from Copilot May 23, 2025 03:41
Copy link

@Copilot Copilot AI left a 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

Comment on lines +38 to +42
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)
Copy link
Preview

Copilot AI May 23, 2025

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).

Suggested change
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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants