auditok.io.Rewindable

class auditok.io.Rewindable(sampling_rate, sample_width, channels)[source]

Base class for rewindable audio streams.

Subclasses should implement a method to return back to the start of an the stream (rewind), as well as a property getter/setter named position that reads/sets stream position expressed in number of samples.

__init__(sampling_rate, sample_width, channels)

Initialize self. See help(type(self)) for accurate signature.

Methods

__init__(sampling_rate, sample_width, channels) Initialize self.
close() Close audio source.
is_open() Return True if audio source is open, False otherwise.
open() Open audio source.
read(size) Read and return size audio samples at most.
rewind() Go back to the beginning of audio stream.

Attributes

ch Number of channels in audio stream (alias for channels).
channels Number of channels in audio stream.
position Return stream position in number of samples.
position_ms Return stream position in milliseconds.
position_s Return stream position in seconds.
sample_width Number of bytes used to represent one audio sample.
sampling_rate Number of samples per second of audio stream.
sr Number of samples per second of audio stream (alias for sampling_rate).
sw Number of bytes used to represent one audio sample (alias for sample_width).