node-taglib-sharp / Exports / FlacBlock
Represents a FLAC metadata block
▪ Static Readonly HEADER_SIZE: 4
Length of a FLAC block header in bytes.
• get blockStart(): number
Offset into the file where the block begins. This is undefined if the instance is
constructed directly from data.
number
• get data(): ByteVector
Gets the data contained in the current instance.
• get dataSize(): number
Gets the size of the data contained in the current instance.
number
• get isLastBlock(): boolean
Gets whether the block represented by the current instance is the last metadata block in the FLAC stream.
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.
• get isLoaded(): boolean
Gets whether the object has been loaded.
boolean
• 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.
number
• get type(): FlacBlockType
Gets the type of data contained in the current instance.
▸ load(): void
Loads the object.
void
▸ render(isLastBlock): ByteVector
Renders the current instance as a raw FLAC metadata block.
| Name | Type | Description |
|---|---|---|
isLastBlock |
boolean |
Whether or not the block should be marked as the last metadata block. |
▸ Static fromData(type, data): FlacBlock
Constructs and initializes a new instance using the type of the block and the data contained in the block.
| Name | Type | Description |
|---|---|---|
type |
FlacBlockType |
Type of the block to construct |
data |
ByteVector |
Data the block will contain |
▸ Static fromFile(file, position): FlacBlock
Constructs and initializes a new instance, lazily, by reading it from a file.
| Name | Type | Description |
|---|---|---|
file |
File |
File from which to read the current instance |
position |
number |
Offset into the file where the block begins |