auditok.io.Rewindable
- class auditok.io.Rewindable(sampling_rate, sample_width, channels)[source]
Base class for rewindable audio sources.
This class serves as a base for audio sources that support rewinding. Subclasses should implement a method to return to the beginning of the stream (rewind), and provide a property position that allows getting and setting the current stream position, expressed in number of samples.
- __init__(sampling_rate, sample_width, channels)
Methods
__init__(sampling_rate, sample_width, channels)close()Close audio source.
is_open()Return True if audio source is open, False otherwise.
open()Open audio source.
read(size)Read and return up to size audio samples.
rewind()Go back to the beginning of audio stream.
Attributes
chNumber of channels in audio stream (alias for channels).
channelsNumber of channels in audio stream.
Return stream position in number of samples.
Return stream position in milliseconds.
Return stream position in seconds.
sample_widthNumber of bytes used to represent one audio sample.
sampling_rateNumber of samples per second of audio stream.
srNumber of samples per second of audio stream (alias for sampling_rate).
swNumber of bytes used to represent one audio sample (alias for sample_width).