UNPKG

apphouse

Version:

Component library for React that uses observable state management and theme-able components.

58 lines (57 loc) 1.58 kB
import { Recorder } from './models/Recorder'; import Microphone from './models/Microphone'; import Visualizer from './models/Visualizer'; import AudioSource from './models/AudioSource'; import Player from './models/Player'; /** * A library for recording audio, playing audio, and visualizing audio. */ export default class AudioX { /** * The recorder object */ recorder: Recorder; /** * The microphone object */ microphone: Microphone; /** * The audio source object */ audioSource: AudioSource; /** * The recorded audio blob */ recordedAudioBlob: Blob | undefined; /** * The recorded audio url */ recordedAudioUrl: string; /** * The visualizer object */ visualizer: Visualizer; /** * The player object */ player: Player; /** * The voice memos */ voiceMemos: any[]; constructor(); get currentVoiceMemos(): any[]; get audioUrl(): string; setRecordedAudioUrl: (url: string) => void; onRecordingComplete: (audio: Blob) => Promise<void>; startRecording: (showLiveFeedback?: boolean) => Promise<void>; stopRecording: () => void; } /** * An observable hook for the audioX object. * Note: This is a singleton object and should be used with caution. * This will be a global object and will be shared across the application. * If you need to use different instances of the audioX object, you should create a new instance instead. * @returns The audioX object */ export declare const useAudioX: () => AudioX;