quasimoto.wave package#
Submodules#
quasimoto.wave.mixins module#
A module hosting mixin classes related to WAVE files.
- class quasimoto.wave.mixins.FormatMixin[source]#
Bases:
LoggerMixinA class mixin for classes that use wave format data.
- byte_order = 2#
- property channels: int#
Get the number of channels in this stream.
- property sample_bits: int#
Get the number of bits per sample.
- property sample_bytes: int#
Get the number of bytes per sample.
- property sample_period: float#
Get the sample period for this data.
- property sample_rate: int#
Get the sample rate.
quasimoto.wave.protocol module#
A module implementing a protocol factory for the ‘fmt ‘ chunk data.
- class quasimoto.wave.protocol.WaveClass(value, names=None, *values, module=None, qualname=None, type=None, start=1, boundary=None)[source]#
Bases:
RuntimeIntEnumAn enumeration for valid kinds of WAVE configurations.
- MONO_8 = 1#
- STEREO_16 = 4#
- STEREO_8 = 2#
quasimoto.wave.reader module#
A module implementing interfaces for reading WAVE files.
- class quasimoto.wave.reader.WaveReader(riff: RiffInterface)[source]#
Bases:
FormatMixinA class for reading and writing WAVE files.
- property duration_s: float#
Get the duration in seconds of this data.
- property duration_str: str#
Get this data’s duration as a human-readable string.
- static from_path(path: Path) Iterator[WaveReader][source]#
Get a WAVE reader from a path.
- property num_samples: int#
Get the number of samples contained.
- property samples: Iterator[tuple[int, ...]]#
Get raw samples as a generator.
quasimoto.wave.writer module#
A module implementing interfaces for writing WAVE files.
- class quasimoto.wave.writer.WaveWriter(riff: RiffInterface, num_channels: int = 2, sample_rate: int = 44100, bits_per_sample: int = 16)[source]#
Bases:
FormatMixinA class for reading and writing WAVE files.
- static from_path(path: Path, **kwargs) Iterator[WaveWriter][source]#
Get a WAVE reader from a path.
Module contents#
A module implementing interfaces for WAVE files.
- class quasimoto.wave.WaveReader(riff: RiffInterface)[source]#
Bases:
FormatMixinA class for reading and writing WAVE files.
- property duration_s: float#
Get the duration in seconds of this data.
- property duration_str: str#
Get this data’s duration as a human-readable string.
- static from_path(path: Path) Iterator[WaveReader][source]#
Get a WAVE reader from a path.
- property num_samples: int#
Get the number of samples contained.
- property samples: Iterator[tuple[int, ...]]#
Get raw samples as a generator.
- class quasimoto.wave.WaveWriter(riff: RiffInterface, num_channels: int = 2, sample_rate: int = 44100, bits_per_sample: int = 16)[source]#
Bases:
FormatMixinA class for reading and writing WAVE files.
- static from_path(path: Path, **kwargs) Iterator[WaveWriter][source]#
Get a WAVE reader from a path.