spdl.io.AudioFrames¶
- class AudioFrames[source]¶
Audio frames.
Methods
clone
()Clone the frames, so that data can be converted to buffer multiple times.
Attributes
The number of channels.
The number of audio frames.
The name of sample format.
The sample rate of audio.
- clone() AudioFrames [source]¶
Clone the frames, so that data can be converted to buffer multiple times.
- Returns:
A clone of the frame.
- property num_frames: int[source]¶
The number of audio frames. Same as
__len__
method.Note
In SPDL,
The number of samples
==the number of frames
xthe number of channels
- property sample_fmt: str[source]¶
The name of sample format.
Possible values are
"u8"
for unsigned 8-bit integer."s16"
,"s32"
,"s64"
for signed 16-bit, 32-bit and 64-bit integer."flt"
,"dbl"
for 32-bit and 64-bit float.
If the frame is planar format (separate planes for different channels), the name will be suffixed with
"p"
. When converted to buffer, the buffer’s shape will be channel-first format(channel, num_samples)
instead of interweaved(num_samples, channel)
.