/** @packageDocumentation ID3v2 relative volume adjustment frame (RVA2). Stores per-channel volume adjustment and peak volume data. */ import { ByteVector } from "../../../byteVector.js"; import { Id3v2Frame, Id3v2FrameHeader } from "../id3v2Frame.js"; /** Channel types for the RVA2 frame. */ export declare enum ChannelType { Other = 0, MasterVolume = 1, FrontRight = 2, FrontLeft = 3, BackRight = 4, BackLeft = 5, FrontCentre = 6, BackCentre = 7, Subwoofer = 8 } /** Peak volume data for a single channel. */ export interface PeakVolume { /** Number of bits used to represent the peak volume value. */ bitsRepresentingPeak: number; /** Raw bytes encoding the peak volume value. */ peakVolume: ByteVector; } /** * Relative volume adjustment frame (RVA2). * * Structure: identification(null-terminated Latin1) + per-channel data blocks. * Each channel block: channelType(1) + volumeAdjustment(2, signed big-endian) * + bitsRepresentingPeak(1) + peakVolume(variable). */ export declare class RelativeVolumeFrame extends Id3v2Frame { /** Identification string that distinguishes this RVA2 frame from others in the same tag. */ private _identification; /** Map from channel type to its volume and peak data. */ private _channelMap; /** Creates a new, empty RVA2 frame. */ constructor(); /** * Gets the identification string that distinguishes this frame from other RVA2 frames. * @returns The identification string. */ get identification(): string; /** * Sets the identification string. * @param value - The new identification string. */ set identification(value: string); /** * Returns an array of all channel types present in this frame. * @returns Array of {@link ChannelType} values stored in this frame. */ get channels(): ChannelType[]; /** * Get volume adjustment index (signed, 1/512 dB units). * @param channel - The channel to query. Defaults to {@link ChannelType.MasterVolume}. * @returns The raw signed 16-bit volume adjustment index. */ volumeAdjustmentIndex(channel?: ChannelType): number; /** * Sets the raw volume adjustment index (signed 16-bit, 1/512 dB units). * @param index - The signed integer index to set; clamped to [-32768, 32767]. * @param channel - The channel to update. Defaults to {@link ChannelType.MasterVolume}. */ setVolumeAdjustmentIndex(index: number, channel?: ChannelType): void; /** * Get volume adjustment as a floating point dB value. * @param channel - The channel to query. Defaults to {@link ChannelType.MasterVolume}. * @returns The volume adjustment in decibels. */ volumeAdjustment(channel?: ChannelType): number; /** * Sets the volume adjustment as a floating-point dB value. * @param adjustment - The volume adjustment in decibels. * @param channel - The channel to update. Defaults to {@link ChannelType.MasterVolume}. */ setVolumeAdjustment(adjustment: number, channel?: ChannelType): void; /** * Returns the peak volume data for the specified channel. * @param channel - The channel to query. Defaults to {@link ChannelType.MasterVolume}. * @returns The {@link PeakVolume} for the given channel. */ peakVolume(channel?: ChannelType): PeakVolume; /** * Sets the peak volume data for the specified channel. * @param peak - The peak volume data to store. * @param channel - The channel to update. Defaults to {@link ChannelType.MasterVolume}. */ setPeakVolume(peak: PeakVolume, channel?: ChannelType): void; /** * Returns the identification string. * @returns The identification string of this frame. */ toString(): string; /** @internal Create from raw frame data. */ static fromData(data: ByteVector, header: Id3v2FrameHeader, version: number): RelativeVolumeFrame; /** * Parses the frame payload into identification and per-channel data. * @param data - The raw field bytes of the frame. * @param _version - The ID3v2 version (unused). */ protected parseFields(data: ByteVector, _version: number): void; /** * Serializes the frame data into bytes. * @param _version - The ID3v2 version (unused). * @returns A {@link ByteVector} containing the encoded frame fields. */ protected renderFields(_version: number): ByteVector; /** * Gets or creates a ChannelData entry for the given channel type. * @param channel - The channel type to look up or create. * @returns The existing or newly created {@link ChannelData} for the channel. */ private _getOrCreate; } //# sourceMappingURL=relativeVolumeFrame.d.ts.map