UNPKG

vban

Version:
49 lines (48 loc) 1.76 kB
import { VBANPacket } from '../VBANPacket.js'; import { Buffer } from 'buffer'; import { ESubProtocol } from '../ESubProtocol.js'; import { EFormatBit } from '../../commons.js'; import { ETextEncoding } from './ETextEncoding.js'; import { IVBANHeaderTEXT } from './IVBANHeaderTEXT.js'; export declare class VBANTEXTPacket extends VBANPacket { /** * {@link VBANTEXTPacket.subProtocol} */ static readonly subProtocol: ESubProtocol; subProtocol: ESubProtocol; /** * Bit rate is given in bps for information only. But it can be used internally to limit the bandwidth of * the stream and for example gives more priority to audio stream or RT MIDI stream. It can be set * to ZERO if there is no particular bit rate. */ bps: number; /** * Can be used to define a sub channel (sub text channel) and then manage up to 256 different * virtual pipes (ZERO by default). */ channelsIdents: number; /** * Data type used to store data in the packet (ZERO/VBAN_DATATYPE_BYTE8 per default). */ formatBit: EFormatBit; /** * Text format */ encoding: ETextEncoding; /** * not used . Replaced by {@link VBANTEXTPacket.bps} */ sr: number; /** * if data can be decoded, it will be decoded in text */ text: string; /** * you can access the raw dataBuffer (if available) to try another decoding */ dataBuffer?: Buffer; constructor(headers: IVBANHeaderTEXT, txt?: string, dataBuffer?: Buffer); static toUDPPacket(packet: VBANTEXTPacket): Buffer; static fromUDPPacket(headersBuffer: Buffer, dataBuffer: Buffer): VBANTEXTPacket; static getEncoding(streamType: ETextEncoding): BufferEncoding | undefined; }