import { TapeDecoder } from "./TapeDecoder.js"; import { Tape } from "./Tape.js"; import { TapeDecoderState } from "./TapeDecoderState.js"; import { BitData } from "./BitData.js"; import { ByteData } from "./ByteData.js"; import { Program } from "./Program.js"; import { WaveformAnnotation } from "./Annotations.js"; export declare enum PulseResultType { PULSE = 0, NOISE = 1, SILENCE = 2 } export declare class Pulse { readonly resultType: PulseResultType; readonly value: number; readonly frame: number; readonly range: number; readonly explanation: string; readonly waveformAnnotations: WaveformAnnotation[]; constructor(resultType: PulseResultType, value: number, frame: number, range: number, explanation: string); } /** * Low-speed (250, 500, and 1000 baud) decoder. * * Originally based on: https://github.com/anteo/wav2cas */ export declare class LowSpeedTapeDecoder implements TapeDecoder { /** * Differentiating filter to accentuate pulses. * * @param samples samples to filter. * @param sampleRate number of samples per second in the recording. * @returns filtered samples. */ static filterSamples(samples: Int16Array, sampleRate: number): Int16Array; static DEFAULT_THRESHOLD: number; private readonly samples; private readonly baud; private readonly period; private readonly halfPeriod; private readonly quarterPeriod; private readonly clockPulseSearchRadius; private readonly dataPulseSearchRadius; private state; private peakThreshold; constructor(tape: Tape, baud: number); findNextProgram(frame: number, waveformAnnotations: WaveformAnnotation[]): Program | undefined; /** * Verifies that we have pulses every period starting at frame. */ proofPulseDistance(frame: number, waveformAnnotations: WaveformAnnotation[]): boolean; /** * Load the program starting at the start frame. */ loadData(startFrame: number, waveformAnnotations: WaveformAnnotation[]): Program; /** * Read a bit at position "frame", which should be the position of the previous bit's clock pulse. * @return the value of the bit, the clock pulse, and the data pulse. */ private readBit; /** * Read a sequence of bits (the characters "0" and "1"). Frame is the position of the previous clock bit. * This is for testing. */ readBits(frame: number): [string, WaveformAnnotation[], string[]]; /** * Look for a pulse in the samples, starting at frame. The pulse may not be the very next one; this * is a fast algorithm to find the pulses in the header. * * @return a pulse if one was found. If one was not found, then the frame ran off the end of the audio. */ findPulse(frame: number, threshold: number): Pulse | undefined; /** * Find the very next pulse of the specified polarity. The pulse must be in the next six periods. */ findNextClosePulse(frame: number, threshold: number, positive: boolean, includeExplanation: boolean): Pulse | undefined; /** * Look for a pulse around frame. */ isPulseAt(frame: number, peakThreshold: number, isDataPulse: boolean, includeExplanation: boolean): Pulse; getBinary(): Uint8Array; getBitData(): BitData[]; getByteData(): ByteData[]; getName(): string; isHighSpeed(): boolean; getState(): TapeDecoderState; } //# sourceMappingURL=LowSpeedTapeDecoder.d.ts.map