Cat Feeder  1.0.0
The Cat feeder project
Loading...
Searching...
No Matches
backend.src.libs.fffamily.pyaudioop Namespace Reference

Functions

Iterable[int] _samples_from_fragment (bytes fragment, int width)
 
int rms (bytes fragment, int width)
 
int max (bytes fragment, int width)
 
int avg (bytes fragment, int width)
 

Detailed Description

Minimal shim providing a subset of the stdlib `audioop` API.

This file is intended as a temporary compatibility layer for
environments where the C-extension `audioop` is missing (e.g. custom
Python builds or stripped-down containers). It implements a few small
helpers that `pydub` commonly calls: `rms`, `max` and `avg`.

This is a light-weight pure-Python implementation and may be slower
than the C-extension for large buffers; it is only intended to
unblock imports and normal usage of `pydub` in CI/dev containers.

Function Documentation

◆ _samples_from_fragment()

Iterable[int] backend.src.libs.fffamily.pyaudioop._samples_from_fragment ( bytes fragment,
int width )
protected

Definition at line 18 of file pyaudioop.py.

◆ avg()

int backend.src.libs.fffamily.pyaudioop.avg ( bytes fragment,
int width )

Definition at line 80 of file pyaudioop.py.

◆ max()

int backend.src.libs.fffamily.pyaudioop.max ( bytes fragment,
int width )

Definition at line 70 of file pyaudioop.py.

◆ rms()

int backend.src.libs.fffamily.pyaudioop.rms ( bytes fragment,
int width )
Return the root-mean-square of audio samples in `fragment`.

Parameters mirror the stdlib `audioop.rms(fragment, width)`.

Definition at line 53 of file pyaudioop.py.