import { ByteVector } from "../../byteVector"; import { Frame, FrameClassType } from "./frame"; import { Id3v2FrameHeader } from "./frameHeader"; /** * Type of channel data to get from or set to a {@link RelativeVolumeFrame} object */ export declare enum ChannelType { /** * Channel data for some other speaker */ Other = 0, /** * Channel data for the master volume */ MasterVolume = 1, /** * Channel data for the front right speaker */ FrontRight = 2, /** * Channel data for front left speaker */ FrontLeft = 3, /** * Channel data for center right speaker */ BackRight = 4, /** * Channel data for back left speaker */ BackLeft = 5, /** * Channel data for front center speaker */ FrontCentre = 6, /** * Channel data for back center speaker */ BackCenter = 7, /** * Channel data for subwoofer */ Subwoofer = 8 } /** * Represents the relative volume data that applies to a specific channel of the audio. */ export declare class ChannelData { private readonly _channel; private _peakBits; private _peakVolume; private _volumeAdjustment; /** * Constructs a new instance of relative volume information that applies to the provided * audio channel. * @param channel Channel that the relative volume information applies to */ constructor(channel: ChannelType); /** * Constructs a new instance from the raw bytes of channel data. * @param bytes Raw bytes that contain the channel data object. */ static fromData(bytes: ByteVector): ChannelData; /** * Gets the channel that the current instance applies to. */ get channelType(): ChannelType; /** * Gets whether the current instance actually contains a relative volume adjustment. */ get isSet(): boolean; /** * Number of bits used to express the peak volume. */ get peakBits(): number; /** * Number of bits used to express the peak volume. * @param value Bits used to express the peak volume. Must be an integer betweenInclusive 1 and 64 */ set peakBits(value: number); /** * Value of the peak sample in the file. It's unclear exactly how this works, but the ID3v2.4 * documentation explains this value as betweenInclusive 0 and 255 - but can be expressed using any * number of bits ({@link peakBits}). */ get peakVolume(): bigint; /** * Value of the peak sample in the file. It's unclear exactly how this works, but the ID3v2.4 * documentation explains this value as betweenInclusive 0 and 255 - but can be expressed using any * number of bits ({@link peakBits}). * @param value Peak volume value. Must fit in the number of bits set in {@link peakBits} */ set peakVolume(value: bigint); /** * Volume adjustment of the track in dB. */ get volumeAdjustment(): number; /** * Volume adjustment of the track in dB. This value is expressed as a fixed-precision value * betweenInclusive -64 and 64. Don't worry about the math, we'll do it for you. * @param value Volume adjustment. Must be between -64 and 64, inclusive. */ set volumeAdjustment(value: number); /** * Generates a raw byte representation of the current instance. */ render(): ByteVector; } /** * Extends {@link Frame}, implementing support for ID3v2 relative volume (RVA2) frames. */ export declare class RelativeVolumeFrame extends Frame { private readonly _channels; private _identification; private constructor(); /** * Constructs and initializes a new instance with a specified identifier * @param identification Identification ot use for the new frame */ static fromIdentification(identification: string): RelativeVolumeFrame; /** * Constructs and initializes a new instance by reading its raw data in a specified ID3v2 * version starting a specified offset. * @param data Raw representation of the new frame * @param offset Offset into `data` where the frame actually begins. Must be a * positive, 32-bit integer * @param header Header of the frame found at `offset` in `data` * @param version ID3v2 version the frame was originally encoded with */ static fromOffsetRawData(data: ByteVector, offset: number, header: Id3v2FrameHeader, version: number): RelativeVolumeFrame; /** * Constructs and initializes a new instance by reading its raw data in a specified ID3v2 * version. * @param data Raw representation of the new frame * @param version ID3v2 version the frame is encoded with. Must be a positive 8-bit integer. */ static fromRawData(data: ByteVector, version: number): RelativeVolumeFrame; /** @inheritDoc */ get frameClassType(): FrameClassType; /** * Gets the channels in the current instance that have a value */ get channels(): ChannelData[]; /** * Gets the identification used for the current instance */ get identification(): string; /** @inheritDoc */ clone(): Frame; /** * Gets a specified volume adjustment frame from the list of relative volume frames * @param frames List of frames to search * @param identification Identification to match * @returns Frame containing the matching user or `undefined` if a match was not found */ static find(frames: RelativeVolumeFrame[], identification: string): RelativeVolumeFrame; /** * Gets the number of bits used to encode the peak volume * @param type Which channel to get the value for */ getPeakBits(type: ChannelType): number; /** * Gets the peak volume for a specified channel * @param type Which channel to get the value for */ getPeakVolume(type: ChannelType): bigint; /** * Gets the volume adjustment for the specified channel. * @param type Which channel to get the value for * @returns Volume adjustment for the channel, can be betweenInclusive -64 and +64 decibels */ getVolumeAdjustment(type: ChannelType): number; /** * Sets the number of bits used to encode peak volume for a specified channel. * @param type Which channel to set the value for * @param value Peak volume */ setPeakBits(type: ChannelType, value: number): void; /** * Sets the peak volume for a specified channel. * @param type Which channel to set the value for * @param value Peak volume */ setPeakVolume(type: ChannelType, value: bigint): void; /** * Sets the volume adjustment in decibels for the specified channel. * @param type Which channel to set the value for * @param value Volume adjustment in decibels. Must be betweenInclusive -64 and +64 */ setVolumeAdjustment(type: ChannelType, value: number): void; /** * Creates a text description of the current instance */ toString(): string; /** @inheritDoc */ protected parseFields(data: ByteVector): void; /** @inheritDoc */ protected renderFields(): ByteVector; }