Audio Chunker is a desktop application for slicing and joining audio files. It uses silence detection to create sensible chunks, allows previewing results, and can re-join segments into a final audio file. The GUI is implemented in desktop_app.py; core processing logic is in smart_slice.py and smart_join.py.
Download the DMG from the latest release, open it, and drag Audio Chunker into your Applications folder.
✅ Signed with Apple Developer ID · Notarized by Apple · No dependencies needed
Open Terminal and paste this:
curl -fsSL https://raw.githubusercontent.com/Pavan-Gopa/AudioChunker/main/install.sh | bashThis downloads the latest version, installs it to /Applications, and cleans up automatically.
- macOS 12 (Monterey) or later
- Apple Silicon Mac (M1 / M2 / M3 / M4)
- Smart Slicing — split audio by silence and stitch small fragments up to a target length.
- Smart Joining — merge chunks back into a single file, with optional segment markers.
- Preview — play chunks inside the app (QMediaPlayer; AVFoundation used on macOS).
- Multi-format — supports WAV, MP3, M4A, FLAC, OGG, MP4 when
ffmpegis available. - Packaged macOS build —
build_app.shcreates a self-contained.app(bundles Python, PyQt6, and a static ffmpeg binary).
- Python 3.12+ (development and building)
- Python packages listed in
requirements.txt(PyQt6, pydub, pyinstaller, etc.) - FFmpeg (required by pydub to decode/encode compressed audio formats). The build script attempts to bundle a macOS ffmpeg binary for the packaged app.
Double-click Launch Audio Chunker.command in Finder.
The launcher creates .venv if it is missing, installs requirements.txt, and starts desktop_app.py.
- Create and activate a virtual environment:
python3 -m venv .venv
source .venv/bin/activate- Install dependencies:
python3 -m pip install -r requirements.txt- Start the app:
python3 desktop_app.pyThe app logs startup information to the terminal and shows runtime messages in the built-in Logs pane.
- Loading:
pydub.AudioSegment.from_file()loads the input audio file. - Silence detection:
pydub.silence.split_on_silence()finds silent segments based on the configured threshold and minimum silence length. - Stitching: adjacent short fragments are concatenated until they reach the target chunk length.
- Export: each chunk is exported in the same format as the input using
AudioSegment.export().
See implementation: smart_slice.py
pydubrequires an externalffmpeg/avconvbinary for MP3, M4A, FLAC, OGG, MP4 support. WAV may work without ffmpeg.- The build script (
build_app.sh) attempts to download a static macOSffmpegbuild intodist/ffmpeg-bundleand includes it in the packaged.appso the app is self-contained. - At runtime the frozen app will set
pydub.AudioSegment.converterto the bundled ffmpeg if found.
Run the included script to create a packaged .app:
chmod +x build_app.sh
./build_app.shWhat the script does (high level):
- Installs Python requirements.
- Attempts to download a static macOS
ffmpegbuild todist/ffmpeg-bundle/ffmpegif missing. - Runs PyInstaller with the app entry
desktop_app.pyand includes PyQt6 translations and multimedia plugin resources. - Removes the ffmpeg-based Qt multimedia plugin from the final bundle to prefer the native
darwin(AVFoundation) backend on macOS (this avoids missing libav*.dylib runtime errors). - Creates compatibility symlinks inside the app
Frameworksdir for libav* names when possible.
After a successful build, the .app is in dist/AudioChunker.app.
Note: If you prefer to bundle the ffmpeg-based Qt multimedia plugin (libffmpegmediaplugin.dylib), you must also bundle matching libav*.dylib versions or install the same libav versions system-wide.
The app bundle is already self-contained: Python, PyQt6, ffmpeg, and ffprobe are packaged inside it, so recipients do not need to install extra dependencies.
To create a drag-and-drop installer image (.dmg):
chmod +x build_release.sh build_dmg.sh notarize_dmg.sh
./build_release.shThis produces an architecture-specific DMG in dist/, for example:
dist/AudioChunker-macOS-arm64.dmg
The DMG contains:
AudioChunker.appApplicationsshortcut
Typical user flow:
- Open the DMG.
- Drag
AudioChunker.appintoApplications. - Launch the app from
Applications.
If you already built the .app and only want to recreate the DMG:
./build_dmg.shIf you have an Apple Developer certificate, you can sign the app and DMG during packaging:
CODESIGN_IDENTITY="Developer ID Application: Your Name (TEAMID)" ./build_release.shTo create a signed and notarized release:
- Save your notarization credentials in Keychain once:
xcrun notarytool store-credentials AudioChunkerNotary \
--apple-id "your-apple-id@example.com" \
--team-id "TEAMID"- Build, sign, notarize, and staple:
CODESIGN_IDENTITY="Developer ID Application: Your Name (TEAMID)" \
NOTARY_PROFILE="AudioChunkerNotary" \
./build_release.sh --notarizeIf the DMG already exists and only notarization is needed:
NOTARY_PROFILE="AudioChunkerNotary" ./notarize_dmg.shWithout Developer ID signing and Apple notarization, the DMG is still portable, but on other Macs users may need Right Click > Open or allow the app in Privacy & Security. For a warning-free double-click install experience, you need:
Developer ID Applicationsigning- Apple notarization of the final DMG
The current packaged build is single-architecture, not universal. The latest build in this repo is arm64, so it runs on Apple Silicon Macs.
If you also need Intel support, there are two practical options:
- Build a separate
x86_64release under Rosetta or on an Intel Mac and ship two DMGs. - Move the full toolchain to genuine
universal2dependencies and then package a universal app.
With the current environment, some bundled Qt framework binaries are arm64 only, so this repo does not currently produce a true universal app bundle.
- Double-click
dist/AudioChunker.appin Finder. - Or run from terminal to see logs:
/path/to/dist/AudioChunker.app/Contents/MacOS/AudioChunker- To debug Qt plugin loading (verbose):
QT_DEBUG_PLUGINS=1 /path/to/dist/AudioChunker.app/Contents/MacOS/AudioChunkerBe aware: the debug mode can produce a lot of output and in some environments the extra debug logging can change timing and cause unstable behavior; use it for diagnosis only.
-
Slice Audio
- Input File(s): pick one file or multiple (enable Batch).
- Output Base Folder: base path where chunk subfolders are created.
- Preserve Original Silences: when checked, the silence sliders are disabled and original silences are preserved (no cutting). Uncheck to enable the sliders.
- Silence Threshold (dB): how quiet a region must be to count as silence (lower = more aggressive cutting).
- Min Silence Length (ms): minimum silence duration to consider a split.
- Target Chunk Length (s): desired length of chunks; short fragments are stitched up to this size.
▶ Start Slicing: begins slicing on a background worker.
-
Preview controls
- Prev / Play / Next: preview chunks via QMediaPlayer. If the multimedia backend is unavailable, preview is disabled but slicing/joining still work if ffmpeg is available.
-
Join Chunks
- Input Folder: folder with chunk files.
- Output Filename and Base Folder: where the final joined file will be saved.
▶ Start Joining: runs join in background.
- Slice via Python API:
python3 - <<'PY'
from smart_slice import prepare_rvc_dataset
prepare_rvc_dataset('path/to/source.mp3','ready_files',keep_silence=False,target_length_ms=120000,silence_thresh=-16,min_silence_len=200)
PY- Join via Python API:
python3 - <<'PY'
from smart_join import smart_join
smart_join('ready_files/source_name','joined_files','final_audio.wav',add_markers=True)
PYThe join step writes results into a source-named subfolder under the output base directory. For the example above, the final files will be created in joined_files/source_name/.
-
No QtMultimedia backends found/Failed to initialize QMediaPlayer:- Playback will be disabled but slicing still works if
ffmpegis available forpydub. - Confirm
libdarwinmediaplugin.dylibexists inside the bundle at:dist/AudioChunker.app/Contents/Frameworks/PyQt6/Qt6/plugins/multimedia/libdarwinmediaplugin.dylib
- Playback will be disabled but slicing still works if
-
Compressed formats fail to load/export (MP3/M4A/FLAC/OGG):
- Ensure
ffmpegis available — systemwhich ffmpegor bundleddist/ffmpeg-bundle/ffmpeg/dist/AudioChunker.app/Contents/Frameworks/ffmpeg.
- Ensure
-
Gatekeeper on macOS blocks app:
- The distributed app is signed and notarized, so this should not happen. If it does, open System Settings → Privacy & Security and click "Open Anyway", or run
xattr -dr com.apple.quarantine /Applications/AudioChunker.appin Terminal.
- The distributed app is signed and notarized, so this should not happen. If it does, open System Settings → Privacy & Security and click "Open Anyway", or run
- Unit tests:
pytest - Example manual test used in development:
testing_file _for_chunking.mp3(sliced withprepare_rvc_datasetand produced chunks inside a source-named folder underready_files).
- Open issues and PRs. Please run tests and lint before submitting.