import FlacTag from "./flacTag"; import { ByteVector } from "../byteVector"; import { File, ReadStyle } from "../file"; import { IFileAbstraction } from "../fileAbstraction"; import { Properties } from "../properties"; import { ISandwichFile } from "../sandwich/sandwichFile"; import { Tag, TagTypes } from "../tag"; /** * This class extends {@link File} to provide tagging and properties for FLAC audio files. * @remarks * A FLAC file is usually tagged using a Xiph comment block with pictures stored in * special FLAC picture blocks. Additionally, like many other file types, ID3v1, ID3v2, and APE * tags can be added to used to tag a FLAC file by storing them at the beginning or end of the * file. To control the type of tags that are created by default when opening the file, see * {@link FlacFileSettings}. */ export default class FlacFile extends File implements ISandwichFile { /** * Magic string that indicates the file is a FLAC file. */ static readonly FILE_IDENTIFIER: ByteVector; private readonly _properties; private readonly _tag; private _metadataBlocks; private _mediaEndPosition; private _mediaStartPosition; /** * Constructs and initializes a new instance of a FLAC file based on the provided file. * @param file File abstraction or path to a file to open as a FLAC file * @param propertiesStyle How in-depth to read the properties of the file */ constructor(file: IFileAbstraction | string, propertiesStyle: ReadStyle); get mediaEndPosition(): number; get mediaStartPosition(): number; get properties(): Properties; get tag(): FlacTag; /** @inheritDoc */ getTag(type: TagTypes, create: boolean): Tag; /** @inheritDoc */ removeTags(types: TagTypes): void; /** @inheritDoc */ save(): void; private readMetadataBlocks; private readPictures; private readProperties; private readXiphComments; }