Skip to content

Codecbase

CodecBase

CodecBase(path, **kwargs)

The base class of the codec.

Parameters
Parameter Default Description
path
str
required

File path (optional file path).

album instance-attribute

album

The album title is taken from the metadata.

artist instance-attribute

artist

The artist is taken from the metadata.

bitrate instance-attribute

bitrate

The number of bits per second of playback (determines the sound quality).

channels instance-attribute

channels

The number of channels in the file.

codec_name class-attribute instance-attribute

codec_name = 'None'

The name of the codec (abbreviation).

codec_priority class-attribute instance-attribute

codec_priority = 0.0

Sorting priority (the lower the value, the earlier it will be processed, checked for compatibility and initialized)

duration instance-attribute

duration

The duration of the sound in seconds.

hidden_name class-attribute instance-attribute

hidden_name = False

Hide the name when displayed in the SeaPlayer.

icon_data instance-attribute

icon_data

A poster in bytes format is obtained from metadata.

name instance-attribute

name

File path (optional file path).

paused instance-attribute

paused

The playback status (True if paused).

playing instance-attribute

playing

The playback status (True if playing).

samplerate instance-attribute

samplerate

The sampling rate in hertz (Hz).

title instance-attribute

title

The title of the sound is taken from the metadata.

__aio_sha1__ async

__aio_sha1__(buffer_size)

Calculating the hash of the file.

Parameters
Parameter Default Description
buffer_size
int
required

The size of the temporary buffer.

Returns
Name Type Description
str str

SHA256 in string format.

__headrepr__

__headrepr__()

The display name in the SeaPlayer.

Returns
Name Type Description
str str

Value self.title + self.artist the displayed in SeaPlayer.

__namerepr__

__namerepr__()

The name that is displayed for the place self.name.

Returns
Name Type Description
str str

Value self.name the displayed in SeaPlayer.

__sha1__

__sha1__(buffer_size)

Calculating the hash of the file.

Parameters
Parameter Default Description
buffer_size
int
required

The size of the temporary buffer.

Returns
Name Type Description
str str

SHA256 in string format.

aio_is_this_codec async staticmethod

aio_is_this_codec(path)

Compatibility check.

Parameters
Parameter Default Description
path
str
required

File path (optional file path).

Returns
Name Type Description
bool bool

True if compatible.

get_pos

get_pos()

Getting the audio playback position in seconds.

Returns
Name Type Description
float float

The position of the audio playback in seconds.

get_volume

get_volume()

Getting the current volume as a percentage.

Returns
Name Type Description
float float

Volume percentage (0.01 == 1%).

is_this_codec staticmethod

is_this_codec(path)

Compatibility check.

Parameters
Parameter Default Description
path
str
required

File path (optional file path).

Returns
Name Type Description
bool bool

True if compatible.

pause

pause()

Put it on pause.

play

play()

Start playing the sound.

set_pos

set_pos(value)

Setting the audio playback position in seconds.

Parameters
Parameter Default Description
value
float
required

The position of the audio playback in seconds.

set_volume

set_volume(value)

Setting the volume value as a percentage.

Parameters
Parameter Default Description
value
float
required

Volume percentage (0.01 == 1%).

stop

stop()

Stop playing the sound.

unpause

unpause()

Take it off the pause.