UNPKG

vban

Version:
46 lines (45 loc) 1.67 kB
import { VBANPacket } from '../VBANPacket.js'; import { ESubProtocol } from '../ESubProtocol.js'; import { EBitsResolutions } from './EBitsResolutions.js'; import { ECodecs } from './ECodecs.js'; import { IVBANHeaderAudio } from './IVBANHeaderAudio.js'; import { IBitResolution } from './IBitResolution.js'; import { Buffer } from 'buffer'; export declare class VBANAudioPacket extends VBANPacket { /** * {@link VBANAudioPacket.subProtocol} */ static readonly subProtocol: ESubProtocol; subProtocol: ESubProtocol; /** * Number of sample is given by an 8 bits unsigned integer (0 – 255) where 0 means 1 sample and * 255 means 256 samples */ nbSample: number; /** * Number of channel is given by an 8 bits unsigned integer (0 – 255) where 0 means 1 channel * and 255 means 256 channels. */ nbChannel: number; /** * Data type used to store audio sample in the packet * Use it to select the correct bitResolution {@link VBANAudioPacket.bitResolutions}, or directly use {@link VBANAudioPacket.bitResolutionObject} */ bitResolution: EBitsResolutions; /** * the bit resolution selected by the id in {@link VBANAudioPacket.bitResolution} */ readonly bitResolutionObject: IBitResolution; /** * Audio codec used */ codec: ECodecs; /** * current audio */ data: Buffer; constructor(headers: IVBANHeaderAudio, data: Buffer); static toUDPPacket(packet: VBANAudioPacket): Buffer; static fromUDPPacket(headersBuffer: Buffer, dataBuffer: Buffer): VBANAudioPacket; static bitResolutions: Record<number, IBitResolution>; }