Skip to main content

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! 🥧

Metadata

Release files for sonicslicer 1.0.0

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for sonicslicer 1.0.0
File Size Uploaded
sonicslicer-1.0.0.tar.gz 27.1 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for sonicslicer 1.0.0
File Interpreter ABI Platform
sonicslicer-1.0.0-py3-none-any.whl Python 3 none any Details

Total release size: 54.2 kB

Release files / sonicslicer-1.0.0.tar.gz

Download URL sonicslicer-1.0.0.tar.gz
Size 27.1 kB
Tags Source
SHA-256 checksum
How to use checksums
932efcd10cc839984899c71b484ae3dafc7b90f9597e8d3ffc6e878588ea9a69
BLAKE2b-256 checksum
How to use checksums
566a6d99eb007f40817bfc4a197b1110482f4c3e97e96a9a511a0ae4c1d71b66
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.1.0 CPython/3.13.7

Release files / sonicslicer-1.0.0-py3-none-any.whl

Download URL sonicslicer-1.0.0-py3-none-any.whl
Size 27.1 kB
Tags Python 3
SHA-256 checksum
How to use checksums
e5ecbc67f7179ffa6a049e39cf1ee71ff39436ec608ce0fe180461186331a1f0
BLAKE2b-256 checksum
How to use checksums
e22090621f9ef51186126f2f0234d3f147a80bf5bd55931b4b62c144659450f3
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.1.0 CPython/3.13.7

Release history Release notifications | RSS feed

This release

1.0.0 This release

2 release files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page