Skip to main content

CLI toolkit for converting text to audio.

Project description

SonicSlicer 🎵✂️

A powerful, well-optimized Python toolkit for splitting and trimming audio files with precision and ease.


Features

  • Smart Audio Splitting: Split audio files by time duration or file size
  • Precision Trimming: Trim audio from start/end or specific time ranges
  • Multi-format Support: Works with WAV, MP3, OGG, FLAC, and AIFF formats
  • Optimized Processing: Efficient memory usage and fast processing
  • Flexible Output: Customizable output format and bitrate settings
  • Automatic Naming: Sequential output filenames with proper numbering

Installation

  1. Install dependencies:

    pip install pydub
    
  2. Install SonicSlicer:

    pip install sonicslicer
    

    Or clone the repository:

    git clone https://github.com/skye-cyber/SonicSlicer.git
    cd sonicslicer
    

Usage Examples

Splitting Audio Files

By Size:

  • Split into 1mb chunks
slicer file.mp3 --split --size 1mb
  • Split into 100kb chunks, discard small last chunk
slicer file.mp3 --split --size 100kb --strict -O splits
  • Single split 5 minutes chunks
slicer file.mp3 --split --duration 1min

By File Time:

  • Single split 5 minutes chunks
slicer file.mp3 --split --duration 5min --format ogg
  • Split into 10 seconds chunks, keep smaller last chunk
slicer file.mp3 --split --duration 10sec --strict -O splits

Trimming Audio Files

  • Trims from 0 to end
slicer file.mp3 --trim
  • Discards the first 10 seconds
slicer fime.mp3 --trim --trim_start 10sec
  • Discards the last 1 minutes
slicer fime.mp3 --trim --trim_end 1min
  • Discards the first 10 and last seconds respectively
slicer fime.mp3 --trim --trim_start 10sec --trim_end 30sec

Constructor

SonicSlicer(output_format="wav", bitrate="192k")
  • output_format: Output audio format (wav, mp3, ogg, flac, aiff)
  • bitrate: Bitrate for compressed formats

Performance Tips

  1. Use WAV for processing: Process in WAV format then convert to compressed formats
  2. Batch processing: Process multiple files in sequence
  3. Memory management: For very large files, consider smaller chunk sizes
  4. Output directory: Use SSDs for faster write speeds when processing large files

Contributing

We welcome contributions! Please see our Contributing Guidelines for details.

License

This program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version.

This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
GNU General Public License for more details.

You should have received a copy of the GNU General Public License
along with this program.  If not, see <https://www.gnu.org/licenses/>.

See the LICENSE file for more details. See the LICENSE file for details.

Support

If you have any questions or issues:

  1. Check the documentation
  2. Search existing issues
  3. Create a new issue with detailed information

Changelog

See CHANGELOG.md for version history and changes.


SonicSlicer - Making audio processing as easy as slicing pie! 🥧

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

sonicslicer-1.0.0.tar.gz (27.1 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

sonicslicer-1.0.0-py3-none-any.whl (27.1 kB view details)

Uploaded Python 3

File details

Details for the file sonicslicer-1.0.0.tar.gz.

File metadata

  • Download URL: sonicslicer-1.0.0.tar.gz
  • Upload date:
  • Size: 27.1 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.13.7

File hashes

Hashes for sonicslicer-1.0.0.tar.gz
Algorithm Hash digest
SHA256 932efcd10cc839984899c71b484ae3dafc7b90f9597e8d3ffc6e878588ea9a69
MD5 08dd33385249afa10aa58a925f005033
BLAKE2b-256 566a6d99eb007f40817bfc4a197b1110482f4c3e97e96a9a511a0ae4c1d71b66

See more details on using hashes here.

File details

Details for the file sonicslicer-1.0.0-py3-none-any.whl.

File metadata

  • Download URL: sonicslicer-1.0.0-py3-none-any.whl
  • Upload date:
  • Size: 27.1 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.13.7

File hashes

Hashes for sonicslicer-1.0.0-py3-none-any.whl
Algorithm Hash digest
SHA256 e5ecbc67f7179ffa6a049e39cf1ee71ff39436ec608ce0fe180461186331a1f0
MD5 50f58194567343afe84fcc5e03204970
BLAKE2b-256 e22090621f9ef51186126f2f0234d3f147a80bf5bd55931b4b62c144659450f3

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page