Skip to main content

A mass treatment script for extracting part of audio files using FFMPEG

Project description

Testing commit

Audio extract

Batch extract part of multiple audio files It's a wrapper around FFMPEG. Give these guys a thumbs up ! https://www.ffmpeg.org/

Build

See build.md

installation

prerequisites

  • ffmpeg installed
  • python installed
  • download and install the wheel file for CLI or gui-x.x.x. from here [https://github.com/makiwara-fr/extract_audio_exercept/releases/latest]

How to - Graphical interface

  • Download audio_extract.exe from here [https://github.com/makiwara-fr/extract_audio_exercept/releases/latest]
  • Put it where ever you want
  • click on the file to launch it

How to - CLI

installation

pip install batch-audio-extract

After installing, the wheel.

In any working directory, create a file parameters.yaml (see example below). If undefined, default parameters will apply.

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

Then launch command in a terminal, in the directory of the parameters.yaml file

audio_extract

see more with

    audio_extract --help

Parameters for parameters.yaml

Parameter Description Default Value
input_dir The directory containing the audio files you want to process. Current directory
output_dir The directory where the extracted audio clips will be saved. The output format is original_filename_extract.mp3. ./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 bin directory if it's not in your system's PATH. Not set
debug (optional) Enables debug mode for more verbose output. False

Parameters for CLI

All parameters from the parameters.yaml file can be overridden via command-line arguments.

Argument Description Corresponding yaml parameter
-d, --debug Enable debug mode. debug
-i, --input Input directory containing audio files. input_dir
-o, --output Output directory for extracted audio files. 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

Examples

  • Extract the first 30 seconds of all audio files in the my_audio directory and save them to my_extracts:

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

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

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

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

batch_audio_extract-0.5.3.tar.gz (287.5 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.5.3-py3-none-any.whl (9.4 kB view details)

Uploaded Python 3

File details

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

File metadata

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

File hashes

Hashes for batch_audio_extract-0.5.3.tar.gz
Algorithm Hash digest
SHA256 d9c908dcf5e015b928f287208b1282ab393640c3dc19e1b37eda365bb3df5a1a
MD5 106835838ff71b6ea67d06688a95f1e0
BLAKE2b-256 b627d147b9e128adce127e6cea59fe045a8d46b54b993e13afdff9da64e3bb52

See more details on using hashes here.

Provenance

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

File metadata

File hashes

Hashes for batch_audio_extract-0.5.3-py3-none-any.whl
Algorithm Hash digest
SHA256 b28e610cf8f43068b37735ae596bb471f28b7a8ac7ba5d76dbfc282b3a15d1e5
MD5 522ccaa139807b554b2bb892f8ba4a69
BLAKE2b-256 63f21a75c6f48f68a1e0c5b57caf8da63fdf6a66bfa164064a21f440039917e9

See more details on using hashes here.

Provenance

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

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