Skip to content

Latest commit

 

History

History
208 lines (116 loc) · 3.76 KB

File metadata and controls

208 lines (116 loc) · 3.76 KB

node-taglib-sharp / Exports / FlacBlock

Class: FlacBlock

Represents a FLAC metadata block

Implements

Table of contents

Properties

Accessors

Methods

Properties

HEADER_SIZE

▪ Static Readonly HEADER_SIZE: 4

Length of a FLAC block header in bytes.

Accessors

blockStart

• get blockStart(): number

Offset into the file where the block begins. This is undefined if the instance is constructed directly from data.

Returns

number


data

• get data(): ByteVector

Gets the data contained in the current instance.

Returns

ByteVector


dataSize

• get dataSize(): number

Gets the size of the data contained in the current instance.

Returns

number


isLastBlock

• get isLastBlock(): boolean

Gets whether the block represented by the current instance is the last metadata block in the FLAC stream.

Returns

boolean

true if the block represented by the current instance was the last one to appear in the file and is followed immediately by the audio data, or false if another block appears after the current one or the block was not read from disk.


isLoaded

• get isLoaded(): boolean

Gets whether the object has been loaded.

Returns

boolean

Implementation of

ILazy.isLoaded


totalSize

• get totalSize(): number

Gets the total size of the block as it appears on disk. This equals the size of the data plus the size of the header.

Returns

number


type

• get type(): FlacBlockType

Gets the type of data contained in the current instance.

Returns

FlacBlockType

Methods

load

▸ load(): void

Loads the object.

Returns

void

Implementation of

ILazy.load


render

▸ render(isLastBlock): ByteVector

Renders the current instance as a raw FLAC metadata block.

Parameters

Name Type Description
isLastBlock boolean Whether or not the block should be marked as the last metadata block.

Returns

ByteVector


fromData

▸ Static fromData(type, data): FlacBlock

Constructs and initializes a new instance using the type of the block and the data contained in the block.

Parameters

Name Type Description
type FlacBlockType Type of the block to construct
data ByteVector Data the block will contain

Returns

FlacBlock


fromFile

▸ Static fromFile(file, position): FlacBlock

Constructs and initializes a new instance, lazily, by reading it from a file.

Parameters

Name Type Description
file File File from which to read the current instance
position number Offset into the file where the block begins

Returns

FlacBlock