API Reference

Quick Import Guide

Import all transforms directly from the main package:

from soundmentations import *

All Available Transforms

PitchShift

Shift the pitch of audio by a specified number of semitones.

RandomPitchShift

Randomly shift the pitch within a specified semitone range.

Limiter

Apply hard limiting to audio samples to prevent clipping.

FadeIn

Fade-in effect for audio samples.

FadeOut

Apply a fade-out effect to the end of audio samples.

Trim

Trim audio to keep only the portion between start_time and end_time.

RandomTrim

Randomly trim audio by selecting a random segment of specified duration.

StartTrim

Trim audio to keep only the portion starting from start_time to the end.

EndTrim

Trim audio to keep only the portion from the start to end_time.

CenterTrim

Trim audio to keep only the center portion of specified duration.

Compose

Compose multiple audio transforms into a sequential pipeline.

Transforms by Category

Pitch Transforms

PitchShift(semitones[, p])

Shift the pitch of audio by a specified number of semitones.

RandomPitchShift([min_semitones, ...])

Randomly shift the pitch within a specified semitone range.

Amplitude Transforms

Limiter([threshold, p])

Apply hard limiting to audio samples to prevent clipping.

FadeIn([duration, p])

Fade-in effect for audio samples.

FadeOut([duration, p])

Apply a fade-out effect to the end of audio samples.

Trim Transforms

Trim([start_time, end_time, p])

Trim audio to keep only the portion between start_time and end_time.

RandomTrim(duration[, p])

Randomly trim audio by selecting a random segment of specified duration.

StartTrim([start_time, p])

Trim audio to keep only the portion starting from start_time to the end.

EndTrim(end_time[, p])

Trim audio to keep only the portion from the start to end_time.

CenterTrim(duration[, p])

Trim audio to keep only the center portion of specified duration.

Composition

Compose(transforms)

Compose multiple audio transforms into a sequential pipeline.