UNPKG

pw-client

Version:

Node.js wrapper for developing PipeWire clients

68 lines (67 loc) 2.42 kB
export type OutputBufferFactory = (numSamples: number) => OutputBuffer; export interface OutputBuffer { get buffer(): ArrayBuffer; set(index: number, signedFloat: number): void; subarray(index: number, sampleCount: number): OutputBuffer; } /** * Audio format class representing different sample formats supported by PipeWire. * Handles conversion between JavaScript Numbers and various binary audio formats. * * Users typically don't need to work with AudioFormat directly - it's handled * internally through quality presets and format negotiation. * * @class AudioFormat * * @example * ```typescript * // Access negotiated format info * console.log(`Stream format: ${stream.format.description}`); * console.log(`Sample rate: ${stream.rate}Hz`); * console.log(`Channels: ${stream.channels}`); * ``` */ export declare class AudioFormat { #private; private constructor(); get enumValue(): number; get byteSize(): number; get BufferClass(): OutputBufferFactory; get description(): string; static fromEnum(format: number): AudioFormat | undefined; static Int8: AudioFormat; static Uint8: AudioFormat; static get Int16(): AudioFormat; static get Uint16(): AudioFormat; static get Int24_32(): AudioFormat; static get Uint24_32(): AudioFormat; static get Int32(): AudioFormat; static get Uint32(): AudioFormat; static get Float32(): AudioFormat; static get Float64(): AudioFormat; static ULaw: AudioFormat; static ALaw: AudioFormat; static Uint8Planar: AudioFormat; static Int16Planar: AudioFormat; static Int24_32Planar: AudioFormat; static Int32Planar: AudioFormat; static Float32Planar: AudioFormat; static Float64Planar: AudioFormat; static Int8Planar: AudioFormat; private static readonly Int16LE; private static readonly Int16BE; private static readonly Uint16LE; private static readonly Uint16BE; private static readonly Int24_32LE; private static readonly Int24_32BE; private static readonly Uint24_32LE; private static readonly Uint24_32BE; private static readonly Int32LE; private static readonly Int32BE; private static readonly Uint32LE; private static readonly Uint32BE; private static readonly Float32LE; private static readonly Float32BE; private static readonly Float64LE; private static readonly Float64BE; }