Pydub version: 0.25.1
pydub-stubs
provides type information for Pydub.
Only the public interface is guaranteed to be typed, however there
are type definitions for some private and undocumented functions.
pip install pydub-stubs
These are legacy types that have been replaced by the channels
,
frame_rate
, and sample_rate
keyword arguments.
- Fixed incorrect
WhiteNoise
generator name
Previously, the generator was incorrectly namedWhitenoise
. (#7 - thanks, @Kakadus!)
- Added "effect" functions as methods on
AudioSegment
The methods have always been accessible on AudioSegment, but since they are not defined on the class, they were not previously defined in the type stubs. Note that ifpydub.scipy_effects
is imported, the effect methods may have slightly different definitions.
- Added
typing.BinaryIO
to_PathLike
Pydub supports using an IO object in place of a file for both creating and exporting AudioSegments. (Fixes #5)
- Added
pathlib.Path
to_PathLike
Allows you to usePath
objects in place of strings. (thanks, @qthequartermasterman!)
-
Removed literal type fallback overloads
The fallbacks removed all the advantages of using literals at all. -
Modernized the type stubs
Uses new union syntax, and more. (#2 and #3 - thanks, @Viicos!) -
Add
WavSubChunk
,WavData
, and undocumented functions
These previously existed and were available but were untyped. (thanks again, @Viicos!)
Previous versions
-
Added v0.25.0 features
This includespydub.scipy_effects.eq
and new classmethod parameters. -
Signatures now use literals where possible
Overloaded implementations exist as a fallback. -
Added missing modules
pydub.silence
andpydub.utils
- Add undocumented parameter of
AudioSegment.from_file
read_ahead_limit
is absent from the documentation but is a supported keyword argument.
- Export other modules
Adds exports for effects, exceptions, generators, playback, and scipy_effects
-
Added
AudioSegment._spawn
(again)
This was accidentally removed in an earlier version. -
Improved
pydub.effects.invert_phase
This is technically less accurate as(0, 0)
is equivalent to(0, 1)
.
- Removed testing symbols from
pydub.audio_segment
- Fixed
AudioSegment.export
First param is namedout_f
and isn't required.
-
Improved signature of
AudioSegment.from_file
The keyword arguments for raw/PCM audio don't requireformat
to be set to eitherraw
orpcm
. -
Fixed package exports
ExportsAudioSegment
from__init__.py
.
- Fixed overloads of
AudioSegment.fade
Exactly two ofstart
,end
, andduration
must be given.
-
Improved
AudioSegment.fade
Changed to use overloads to prevent invalid method calls. -
Improved
AudioSegment.from_mono_audiosegments
Use a positional-only parameter to ensure there's at least 1 argument.
-
Fixed
AudioSegment.__init__
Use overloads to model correct parameters. -
Fixed
AudioSegment._spawn
Parameteroverrides
accepts a partial dictionary. -
Fixed
pydub.scipy_effects.high_pass_filter
Parameterorder
should beint
, notfloat
.
Released