1.0.4 • Published 6 months ago

@types/recorder-js v1.0.4

Weekly downloads
374
License
MIT
Repository
github
Last release
6 months ago

Installation

npm install --save @types/recorder-js

Summary

This package contains type definitions for recorder-js (https://github.com/ijsnow/studiojs#readme).

Details

Files were exported from https://github.com/DefinitelyTyped/DefinitelyTyped/tree/master/types/recorder-js.

index.d.ts

// Type definitions for recorder-js 1.0
// Project: https://github.com/ijsnow/studiojs#readme
// Definitions by: Yusuke Higuchi <https://github.com/higuri>
// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
// TypeScript Version: 2.2

export = Recorder;

declare class Recorder {
    constructor(audioContext: AudioContext, config?: Recorder.RecorderConfig);
    static download(blob: Blob, filename: string): void;
    init(stream: MediaStream): Promise<void>;
    start(): Promise<MediaStream | undefined>;
    stop(): Promise<Recorder.RecorderResult>;
}

declare namespace Recorder {
    type OnAnalysedHandler = (data: number[], lastNonZero: number) => void;

    interface RecorderConfig {
        onAnalysed?: OnAnalysedHandler | undefined;
    }

    interface RecorderResult {
        blob: Blob;
        buffer: Float32Array[];
    }
}

Additional Details

  • Last updated: Thu, 08 Jul 2021 22:41:48 GMT
  • Dependencies: none
  • Global values: none

Credits

These definitions were written by Yusuke Higuchi.