JarodMica / audiosplitter

MIT License
27 stars 10 forks source link

GUI removed, CLI added 🫡 #2

Closed derektata closed 1 year ago

derektata commented 1 year ago

Refactor and enhance audiosplitter.py for better readability and functionality

Changes Made
  1. Imports Reorganized: The import statements have been reorganized for better readability and to follow PEP 8 standards.
  2. Function Names and Signatures: Modified function names and their signatures to be more Pythonic and clear.
  3. Type Annotations: Added type annotations to function arguments and return types.
  4. Removed Tkinter: Removed the Tkinter GUI logic and switched to argparse for command-line arguments.
  5. Code Style: Applied PEP 8 formatting across the code.
  6. Logic Refactor: Replaced custom loops with Python built-in functions and idiomatic structures where applicable.
  7. Comments and Docstrings: Added and updated comments and docstrings for better code documentation.
  8. Argument Parsing: Added argparse for command-line argument parsing.
Revised Reasoning and Process
  1. Imports and Code Style: Reorganized imports and applied PEP 8 formatting to enhance code readability and maintenance.
  2. Function Refactor: Modified function names, signatures, and added type annotations for better readability and type checking.
  3. UI Change: Removed Tkinter to enable easier automation and system integration, replacing it with argparse for command-line interaction.
  4. Logic Optimization: Replaced custom loops with Pythonic structures for efficiency.
  5. Documentation: Updated comments and docstrings to clarify code functionality.
Pros and Cons of Changes
Testing

The code was tested for various audio files and confirmed that the logic for audio splitting and segmenting remains functional.

Summary

This commit refactors the code for improved readability, maintainability, and functionality while also switching from a GUI to a command-line interface.