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

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.1.tar.gz (287.4 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.1-py3-none-any.whl (9.4 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: batch_audio_extract-0.5.1.tar.gz
  • Upload date:
  • Size: 287.4 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.1.tar.gz
Algorithm Hash digest
SHA256 78dcd0465bd8753abaa6828787efe7c98d23d32cb7d26442b13cc7c4acd7ff21
MD5 8c98141e14a6353412f03980ab9df4e6
BLAKE2b-256 188b55abfe6f51a96b957c9d32cde13d19bd331ce1a2939c12ec39b8aec5710d

See more details on using hashes here.

Provenance

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

File metadata

File hashes

Hashes for batch_audio_extract-0.5.1-py3-none-any.whl
Algorithm Hash digest
SHA256 3cdbbd09e45477f943c0ef9b71a07c29691a86b12f6aa94d1aa501a8d11fc2d2
MD5 df630a3c8c1c3f76b83cb1e463161ce1
BLAKE2b-256 8ba7abe414fa36c66ddb784cdedcb8577338603fc93464770efe150ad35f4d97

See more details on using hashes here.

Provenance

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

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