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.6.0.tar.gz (288.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.6.0-py3-none-any.whl (9.9 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: batch_audio_extract-0.6.0.tar.gz
  • Upload date:
  • Size: 288.1 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.6.0.tar.gz
Algorithm Hash digest
SHA256 7d1a833ac954f19383918e4a997eed879ded590dc0789974e0ebf1c1724e4cef
MD5 1fcf79de1df6792d0327ffe8fab3bdc2
BLAKE2b-256 7116d436111172367678499023a874c5fff70ebcf34859b77780f9c3ce075a66

See more details on using hashes here.

Provenance

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

File metadata

File hashes

Hashes for batch_audio_extract-0.6.0-py3-none-any.whl
Algorithm Hash digest
SHA256 d15ab63231cd0f22c718070d77b037080fe8a8f03fbfc0e303ea3c33270b437a
MD5 e7bcb1c57afe87424204aaf094da2130
BLAKE2b-256 165b16d4d97c1002bbd5e7e49dc95a2fcd70f3f3d27d8f8e53f234af787b809a

See more details on using hashes here.

Provenance

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

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