Fork me on GitHub
Release:
Date:
0.3.2
Aug 10, 2011
Flattr Flacsync

Table Of Contents

Download

Get latest source archive,
flacsync-0.3.2.tar.gz, or install with:

pip install flacsync --upgrade --user

Found a Bug?

Fill out a report on the issue tracker.

This Page

3.3. flacsync.encoder

Define interface to encoders available for processing FLAC files.

class flacsync.encoder.AacEncoder(aac_q, **kwargs)[source]

Bases: flacsync.encoder._Encoder

FLAC to AAC encoder.

Parameters:aac_q (str) – AAC encoder quality value [0 - 1]
encode(force=False)[source]

Performs audio encoding process.

Parameters:force (boolean) – When True, encoding will be done, even if destination file exists.
Returns:True if (re)encoding occurred and no errors, False otherwise
set_cover(force=False, resize=False)[source]

Attach album cover image to AAC file.

Parameters:
  • force (boolean) – When True, encoding will be done, even if destination file exists.
  • resize (boolean) – When True, cover art will be resized to predefined size.
tag(tags)[source]

Copies FLAC tags into destination AAC file.

Parameters:tags (dict) – Source tag values from FLAC file.
class flacsync.encoder.Mp3Encoder(mp3_q, **kwargs)

Bases: flacsync.encoder._Encoder

FLAC to MP3 encoder.

Parameters:mp3_q (str) – MP3 VBR encoder quality value [0 - 9]
encode(force=False)

Performs audio encoding process.

Parameters:force (boolean) – When True, encoding will be done, even if destination file exists.
Returns:True if (re)encoding occurred and no errors, False otherwise
set_cover(force=False, resize=False)

Attach album cover image to MP3 file.

Parameters:
  • force (boolean) – When True, encoding will be done, even if destination file exists.
  • resize (boolean) – When True, cover art will be resized to predefined size.
tag(tags)

Copies FLAC tags into destination MP3 file.

Parameters:tags (dict) – Source tag values from FLAC file.
class flacsync.encoder.OggEncoder(ogg_q, **kwargs)[source]

Bases: flacsync.encoder._Encoder

FLAC to OGG encoder.

Parameters:ogg_q (str) – OGG encoder quality value [1 - 10]
encode(force=False)[source]

Performs audio encoding process.

Parameters:force (boolean) – When True, encoding will be done, even if destination file exists.
Returns:True if (re)encoding occurred and no errors, False otherwise
set_cover(force=False, resize=False)[source]

Attach album cover image to OGG file.

This function is experimental, since not many players support embedded images in OGG files.

See also

Refer to the METADATA_BLOCK_PICTURE specification for more details regarding embedded vorbis images.

Parameters:
  • force (boolean) – When True, encoding will be done, even if destination file exists.
  • resize (boolean) – When True, cover art will be resized to predefined size.
tag(tags)[source]

No-op, since tags are automatically updated during encoding.

Returns:True
flacsync.encoder.COVERS

List of album covers, in preferential order.

flacsync.encoder.NULL

File handle to /dev/null

flacsync.encoder.THUMBSIZE

Resolution of re-sized album covers.