Skip to main content

Audio Extract

Testing commit

A powerful, easy-to-use batch audio extraction tool wrapping FFmpeg. Extract specific segments of multiple audio files in one go, either via a graphical user interface (GUI) or a command line interface (CLI).


Features

  • Batch Processing: Extract excerpts from all audio files (e.g., MP3, WAV) in a directory simultaneously.
  • Dual Interfaces: Use the intuitive Graphical User Interface (GUI) or the automation-friendly Command Line Interface (CLI).
  • Flexible Configuration: Define settings once in a parameters.yaml file, or override them dynamically in the CLI.
  • Fade Effects: Apply smooth fade-out/fade-in transitions to extracted clips.
  • FFmpeg Integration: Auto-detects FFmpeg on your system PATH or allows specifying a custom path.

Prerequisites


Installation

From Releases (Pre-built Wheel/Executable)

Download the latest wheels or standalone executable from Releases.


Usage

🖥️ Graphical Interface (GUI) - On Linux or Mac OS

The GUI allows you to select directories, adjust start/end times, toggle fade effects, and run extractions visually.

  1. Launch the GUI by running:
    audio_extract_gui
    
  2. Choose the input folder, set your extraction duration, and click Process.

🖥️ Graphical Interface (GUI) - On Windows

  1. Download and run the standalone audio_extract.exe directly from the Releases page.
  2. Choose the input folder, set your extraction duration, and click Process.

💻 Command Line Interface (CLI)

To run the CLI, navigate to your desired directory and execute:

audio_extract

By default, the CLI will look for a parameters.yaml file in the current directory to read configuration parameters.

Configuration File (parameters.yaml)

Create a parameters.yaml file in your working directory to customize the default run behavior:

input_dir: "input"
output_dir: "output"
first_second: 0
last_second: 120
input_file_extension: ["mp3", "wav"]

YAML Configuration Parameters

Parameter Description Default Value
input_dir The directory containing the audio files to process. Current directory
output_dir The directory where the extracted audio clips will be saved. ./output/
first_second The start time (in seconds) for the audio extraction. 0
last_second The end time (in seconds) for the audio extraction. 60
input_file_extension A list of file extensions to be considered for processing. ["mp3", "wav"]
path_ffmpeg (optional) The path to the FFmpeg directory/binary if it is not in your system's PATH. Auto-detect
debug (optional) Enables debug mode for verbose logging. False

Command-Line Arguments

All parameters from parameters.yaml can be overridden using arguments:

Argument Description YAML Parameter
-i, --input Input directory containing audio files input_dir
-o, --output Output directory for extracted clips output_dir
-s, --start Starting second for the audio excerpt first_second
-e, --end Ending second for the audio excerpt last_second
-f, --fade Fade duration in seconds (0 for no fade) fade_d
-d, --debug Enable debug mode debug

To view the CLI help menu, run:

audio_extract --help

Examples

  • Extract the first 30 seconds of all files from my_audio and save to my_extracts:

    audio_extract --input my_audio --output my_extracts --start 0 --end 30
    
  • Extract from second 60 to 120 with a 3-second fade duration:

    audio_extract --start 60 --end 120 --fade 3
    
  • Run in debug mode with a custom input directory:

    audio_extract --debug --input /path/to/your/audio
    

Build from Source

For development instructions and packaging details, please refer to build.md.

Download files

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

Source Distribution

batch_audio_extract-0.7.1.tar.gz (290.3 kB view details)

Uploaded Source

Built Distribution

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

batch_audio_extract-0.7.1-py3-none-any.whl (11.4 kB view details)

Uploaded Python 3

File details

Details for the file batch_audio_extract-0.7.1.tar.gz.

File metadata

  • Download URL: batch_audio_extract-0.7.1.tar.gz
  • Upload date:
  • Size: 290.3 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.12

File hashes

Hashes for batch_audio_extract-0.7.1.tar.gz
Algorithm Hash digest
SHA256 f02659002162fea0415efdf50efc6dd7e0f3f5b9e36b7facecf5627d13e46953
MD5 583c72d1c8ec7ab9fbdfcba37b0a91fd
BLAKE2b-256 780804c632d03b2e3a67c8fbd616476d2a9c84e7bc092bb6a11db3f6dffebb45

See more details on using hashes here.

Provenance

The following attestation bundles were made for batch_audio_extract-0.7.1.tar.gz:

Publisher: release.yml on makiwara-fr/audio_extract

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file batch_audio_extract-0.7.1-py3-none-any.whl.

File metadata

File hashes

Hashes for batch_audio_extract-0.7.1-py3-none-any.whl
Algorithm Hash digest
SHA256 13f6260cd1a9588bbde539f7d0ab849129fc9cee49cba28c6cdb8bf175a03f0d
MD5 b98b945e9e5a8d79947b47b22f8eeb52
BLAKE2b-256 e65fc3241b5ea90eb116246a0e36af9b4d337a7ac593892a9a9887dabef4c094

See more details on using hashes here.

Provenance

The following attestation bundles were made for batch_audio_extract-0.7.1-py3-none-any.whl:

Publisher: release.yml on makiwara-fr/audio_extract

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

Release history Release notifications | RSS feed

0.7.2

2 files

This release

0.7.1 This release

2 files

0.7.0

2 files

0.6.0

2 files

0.5.3

2 files

0.5.1

2 files

Supported by

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