@types/react-mic
TypeScript icon, indicating that this package has built-in type declarations

12.4.6 • Public • Published

Installation

npm install --save @types/react-mic

Summary

This package contains type definitions for react-mic (https://hackingbeauty.github.io/react-mic).

Details

Files were exported from https://github.com/DefinitelyTyped/DefinitelyTyped/tree/master/types/react-mic.

index.d.ts

import * as React from "react";

/**
 * Record a user's voice and display as an oscillation (or frequency bars).
 */
export class ReactMic extends React.PureComponent<ReactMicProps> {}

/**
 * The object sent when the recording stops
 */
export interface ReactMicStopEvent {
    blob: Blob;
    startTime: number;
    stopTime: number;
    option: {
        audioBitsPerSecond: number;
        mimeType: string;
    };
    blobURL: string;
}

export interface ReactMicProps {
    /** Set to true to begin recording */
    record?: boolean | undefined;

    /** Available in React-Mic-Plus upgrade only */
    pause?: boolean | undefined;

    visualSetting?: "sinewave" | "frequencyBars" | undefined;

    className?: string | undefined;

    /** Callback that is executed when audio stops recording */
    onStop?: ((recordedData: ReactMicStopEvent) => void) | undefined;

    /** Callback that is executed when chunk of audio is available */
    onData?: ((recordedData: Blob) => void) | undefined;

    /** defaults -> "audio/webm".  Set to "audio/wav" for WAV or "audio/mp3" for MP3 audio format (available in React-Mic-Gold) */
    mimeType?: "audio/webm" | "audio/wav" | undefined;

    /** Sound wave color */
    strokeColor?: string | undefined;

    /** Background color */
    backgroundColor?: string | undefined;

    /** Specify 1 for mono, defaults -> 2 (stereo) */
    channelCount?: 1 | 2 | undefined;

    /** Enables/disables echo cancellation, defaults -> false */
    echoCancellation?: boolean | undefined;

    /** Enables/disables auto gain control, defaults -> false */
    autoGainControl?: boolean | undefined;

    /** Enables/disables background noise suppression, defaults -> false */
    noiseSuppression?: boolean | undefined;
}

Additional Details

  • Last updated: Tue, 07 Nov 2023 09:09:39 GMT
  • Dependencies: @types/react

Credits

These definitions were written by mikaello.

Readme

Keywords

none

Package Sidebar

Install

npm i @types/react-mic

Weekly Downloads

1,890

Version

12.4.6

License

MIT

Unpacked Size

6.13 kB

Total Files

5

Last publish

Collaborators

  • types