Cut Silences
The cut-silences command is an essential utility for audio editors, podcasters, and content creators who wish to refine the auditory experience of their content. It meticulously scans the provided audio file and removes all the detected silent portions, ensuring the end result is a continuous and engaging audio piece without abrupt or prolonged gaps.
Features:
-
Simple Input: The command needs just the source
audio_fileand the desiredoutput_filewhere the processed audio will be saved. -
Efficient Silence Removal: Leveraging advanced algorithms, this tool efficiently detects and eliminates silences, making the audio flow more natural.
-
Customizable Detection: Users have the flexibility to define what constitutes a 'silence' in their audio:
silence-time(or-s): Determines the minimum duration of a silence (measured in milliseconds) before it's considered for removal.threshold(or-t): Sets the decibel level below which an audio segment is considered silent.
Example Usage:
To remove silences from an audio file named podcast.mp3 and save the processed audio as podcast_no_silences.mp3, use:
vmh cut-silences podcast.mp3 podcast_no_silences.mp3
--help Flag Output:
$ vmh cut-silences --help
Usage: vmh cut-silences [OPTIONS] AUDIO_FILE OUTPUT_FILE
Removes all silences from an audio file.
â•─ Arguments ─────────────────────────────────────────────────────────────────────────╮
│ * audio_file PATH [default: None] [required] │
│ * output_file PATH [default: None] [required] │
╰─────────────────────────────────────────────────────────────────────────────────────╯
â•─ Options ───────────────────────────────────────────────────────────────────────────╮
│ --silence-time -s INTEGER Minimal time in ms for │
│ configure a silence │
│ [default: 400] │
│ --threshold -t INTEGER Value in db for detect │
│ silence │
│ [default: -65] │
│ --distance -d [negative|tiny|small|medium| Distance betweet silences │
│ large|huge] [default: tiny] │
│ --help Show this message and exit. │
╰─────────────────────────────────────────────────────────────────────────────────────╯
API for developers
Source code in videomaker_helper/audio.py
77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 | |