Package timeside :: Module api :: Class IEncoder
[hide private]
[frames] | no frames]

Class IEncoder

source code

         object --+        
                  |        
component.Interface --+    
                      |    
             IProcessor --+
                          |
                         IEncoder

Encoder driver interface. Each encoder is expected to support a specific format.

Instance Methods [hide private]
 
__init__(self, output)
Create a new encoder.
source code
 
set_metadata(self, metadata)
Set the metadata to be embedded in the encoded output.
source code

Inherited from IProcessor: blocksize, channels, mediainfo, post_process, process, release, samplerate, setup, totalframes

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

Static Methods [hide private]
 
format()
Return the encode/encoding format as a short string Example: "MP3", "OGG", "AVI", ...
source code
 
description()
Return a string describing what this encode format provides, is good for, etc...
source code
 
file_extension()
Return the filename extension corresponding to this encode format
source code
 
mime_type()
Return the mime type corresponding to this encode format
source code

Inherited from IProcessor: id, uuid

Properties [hide private]

Inherited from object: __class__

Method Details [hide private]

__init__(self, output)
(Constructor)

source code 

Create a new encoder. output can either be a filename or a python callback function/method for streaming mode.

The streaming callback prototype is: callback(data, eod) Where data is a block of binary data of an undetermined size, and eod True when end-of-data is reached.

Overrides: object.__init__

description()
Static Method

source code 

Return a string describing what this encode format provides, is good for, etc... The description is meant to help the end user decide what format is good for him/her

set_metadata(self, metadata)

source code 

Set the metadata to be embedded in the encoded output.

In non-streaming mode, this method updates the metadata directly into the output file, without re-encoding the audio data, provided this file already exists.

It isn't required to call this method, but if called, it must be before process().