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.0.tar.gz (290.1 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.0-py3-none-any.whl (11.4 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: batch_audio_extract-0.7.0.tar.gz
  • Upload date:
  • Size: 290.1 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.0.tar.gz
Algorithm Hash digest
SHA256 18f52cf6857cf6ba10670428dbe0101b3d08d6c398295af5f26a93d5c4c22ba3
MD5 67471210fab6611b6071868344bcb362
BLAKE2b-256 9835641c48c6fc74c2f38441f971482063a2a318b36bb4e15723a683f2f7b87b

See more details on using hashes here.

Provenance

The following attestation bundles were made for batch_audio_extract-0.7.0.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.0-py3-none-any.whl.

File metadata

File hashes

Hashes for batch_audio_extract-0.7.0-py3-none-any.whl
Algorithm Hash digest
SHA256 ce7d33ed54e275f17b79174a7bd1f3630170cdbabd4ff15b70f3c806df09c1e6
MD5 59f99c11b95938c6566010cfcc0d0bb3
BLAKE2b-256 3d40606785f8e4181264be0265fa9d2d7cad8e42f77a8a19eef5b08f85647f68

See more details on using hashes here.

Provenance

The following attestation bundles were made for batch_audio_extract-0.7.0-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

0.7.1

2 files

This release

0.7.0 This release

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