tool¶
audio manipulation tool.
Classes
audio manipulation tool. |
- class ManipulationTool(overwrite=False, verbose=True)[source]¶
Bases:
Tool
audio manipulation tool.
- Parameters:
overwrite (
bool
) – Whether to overwrite existing files, otherwise raise an error.verbose (
Union
[bool
,int
]) – Whether to execute the computation verbosely.
- convert(audio_path, mono_audio_path)[source]¶
Converts an audio track to a .wav audio track with 32kHz sample rate.
- Parameters:
audio_path (
Union
[str
,Path
]) – Path to the audio track.mono_audio_path (
Union
[str
,Path
]) – Path to the converted audio track.
- Returns:
- extraction(video_path, audio_path)[source]¶
Extracts the audio track from a video.
- Parameters:
video_path (
Union
[str
,Path
]) – Path to the video.audio_path (
Union
[str
,Path
]) – Path to the audio track.
- Returns:
- mixdown(mono_audio_paths, mixed_audio_path)[source]¶
Mixes multiple mono audio tracks.
- Parameters:
mono_audio_paths (
Sequence
[Union
[str
,Path
]]) – Paths to mono audio tracks.mixed_audio_path (
Union
[str
,Path
]) – Path to the mixed audio track.
- Returns:
- normalization(audio_path, normalized_audio_path)[source]¶
Normalizes an audio track.
- Parameters:
audio_path (
Union
[str
,Path
]) – Path to the audio track.normalized_audio_path (
Union
[str
,Path
]) – Path to the normalized audio track.
- Returns:
- split(stereo_audio_path, left_audio_path, right_audio_path)[source]¶
Splits a stereo audio track into two mono audio tracks.
- Parameters:
stereo_audio_path (
Union
[str
,Path
]) – Path to the stereo audio track.left_audio_path (
Union
[str
,Path
]) – Path to the left channel mono audio track.right_audio_path (
Union
[str
,Path
]) – Path to the right channel mono audio track.
- Returns:
- trim(audio_path, trimmed_audio_path, start_time=None, end_time=None)[source]¶
Trims an audio track by specifying start time, end time, or both.
- Parameters:
audio_path (
Union
[str
,Path
]) – Path to the input audio track.trimmed_audio_path (
Union
[str
,Path
]) – Path to the output trimmed audio track.start_time (
float
) – Start time in seconds (None to keep from beginning).end_time (
float
) – End time in seconds (None to keep until end).
- Returns: