@fishjam-cloud/react-client
Version:
React client library for Fishjam
54 lines • 1.91 kB
TypeScript
/**
* Manage microphone
* @category Devices
*/
export declare function useMicrophone(): {
/** Toggles current microphone on/off */
toggleMicrophone: () => Promise<undefined | import("../..").DeviceError>;
/** Mutes/unmutes the microphone */
toggleMicrophoneMute: () => Promise<void>;
/** Stops the microphone */
stopMicrophone: () => void;
/** Starts the microphone */
startMicrophone: (deviceId?: string | null) => Promise<[MediaStreamTrack, null] | [null, import("../..").DeviceError]>;
/** Selects the microphone device */
selectMicrophone: (deviceId: string) => Promise<undefined | import("../..").DeviceError>;
/**
* @deprecated Use `currentMicrophone` and `isMicrophoneOn` instead
* Indicates which microphone is now turned on and streaming audio
*/
activeMicrophone: import("../..").DeviceItem | null;
/**
* Indicates which microphone is now selected
*/
currentMicrophone: MediaDeviceInfo | null;
/**
* Indicates whether the microphone is streaming audio
*/
isMicrophoneOn: boolean;
/**
* Indicates whether the microphone is muted
*/
isMicrophoneMuted: boolean;
/**
* The MediaStream object containing the current audio stream
*/
microphoneStream: MediaStream | null;
/**
* The currently set microphone middleware function
*/
currentMicrophoneMiddleware: import("../..").TrackMiddleware;
/**
* Sets the microphone middleware
*/
setMicrophoneTrackMiddleware: (middleware: import("../..").TrackMiddleware | null) => Promise<void>;
/**
* List of available microphone devices
*/
microphoneDevices: import("../..").DeviceItem[];
/**
* Possible error thrown while setting up the microphone
*/
microphoneDeviceError: import("../..").DeviceError | null;
};
//# sourceMappingURL=useMicrophone.d.ts.map