Audio class - Quefumas/gensound GitHub Wiki
TODO
Basically a wrapper for numpy.ndarray
object, with shape being (num_channels, num_samples)
, data type numpy.float64
.
Some properties are described below, but note that this won't necessarily reflect recent changes in code, so you are encouraged to read the code instead.
Audio.audio
- thendarray
with the audio data, as aboveAudio.num_channels
Audio.length
- returns number of samplesAudio.duration
- returns duration in ms (float)Audio.shape
- returnsAudio.audio.shape
Audio.to_length(self, length)
- ensures has at leastlength
samples, padding with zeros if needed. Does not crop.Audio.extend(self, how_much)
- always addshow_much
zero samples at the end.