Audio Extraction Utility: From Video to Audio
- Author: @mratanusarkar
- Created: May 15, 2025
- Last Updated: May 15, 2025
- Compatible with: Audim v0.0.6
This guide introduces Audim's new Extract utility for seamlessly extracting high-quality audio from video files. This simple yet powerful feature streamlines the podcast production workflow by eliminating the need for external tools, and can be used in various other use cases and scenarios in the podcast production workflow.
Overview
The Extract utility provides a clean interface for:
- Video-to-Audio Conversion: Extract audio from podcast videos
- Format Flexibility: Support for WAV, MP3, FLAC, and other formats
- Quality Control: Configurable bitrate and sample rate
Basic Usage
Extracting audio from a video file is straightforward:
from audim.utils.extract import Extract
# Set input and output file paths
input_file = "./input/podcast.mp4"
output_file = "./output/podcast.wav"
output_format = "wav"
# Extract audio from video
extractor = Extract()
extractor.extract_audio(input_file, output_file, output_format)
Advanced Options
For more control over the extraction process:
from audim.utils.extract import Extract
extractor = Extract()
extractor.extract_audio(
input_path="./input/podcast.mp4",
output_path="./output/podcast.mp3",
output_format="mp3",
bitrate="320k",
sample_rate=48000
)
Integration with Audim Workflow
This utility complements the existing Audim modules:
- Extract audio from your recorded video using
Extract.extract_audio() - Generate subtitles with
aud2subfrom the extracted audio (see Podcast Subtitling) - Produce podcasts with
sub2podfrom the extracted audio and generated subtitles (see Podcast Videos)