Package timeside :: Module core :: Class FixedSizeInputAdapter
[hide private]
[frames] | no frames]

Class FixedSizeInputAdapter

source code

object --+
         |
        FixedSizeInputAdapter

Utility to make it easier to write processors which require fixed-sized input buffers.

Instance Methods [hide private]
 
__init__(self, buffer_size, channels, pad=False)
Construct a new adapter: buffer_size is the desired buffer size in frames, channels the number of channels, and pad indicates whether the last block should be padded with zeros.
source code
 
blocksize(self, input_totalframes)
Return the total number of frames that this adapter will output according to the input_totalframes argument
source code
 
process(self, frames, eod)
Returns an iterator over tuples of the form (buffer, eod) where buffer is a fixed-sized block of data, and eod indicates whether this is the last block.
source code

Inherited from object: __delattr__, __format__, __getattribute__, __hash__, __new__, __reduce__, __reduce_ex__, __repr__, __setattr__, __sizeof__, __str__, __subclasshook__

Properties [hide private]

Inherited from object: __class__

Method Details [hide private]

__init__(self, buffer_size, channels, pad=False)
(Constructor)

source code 

Construct a new adapter: buffer_size is the desired buffer size in frames, channels the number of channels, and pad indicates whether the last block should be padded with zeros.

Overrides: object.__init__

process(self, frames, eod)

source code 

Returns an iterator over tuples of the form (buffer, eod) where buffer is a fixed-sized block of data, and eod indicates whether this is the last block. In case padding is deactivated the last block may be smaller than the buffer size.