gamut.audio

AudioBuffer

class gamut.audio.AudioBuffer(y=None, sr=None, bit_depth=24)

Audio buffer class to read, write, and play back audio files.

y: np.array

numpy array of audio samples.

sr: int | None

audio sampling rate.

bit_depth: int

audio bit depth.

convolve(impulse_response, mix=0.125, normalize=True)

Applies impulse response convolution to audio

read(input_dir, sr=None, mono=False)

Reads a .wav or .aif audio file from disk

set_sampling_rate(sr)

Sampling rate setter method

stop()

Stops audio buffer when using blocking=True in play method

to_mono()

Converts audio channels to mono