@livekit/react-native-webrtc
Version:
WebRTC for React Native
135 lines (134 loc) • 3.78 kB
TypeScript
export declare enum AudioEngineMuteMode {
Unknown = -1,
VoiceProcessing = 0,
RestartEngine = 1,
InputMixer = 2
}
export interface AudioEngineAvailability {
isInputAvailable: boolean;
isOutputAvailable: boolean;
}
export declare const AudioEngineAvailability: {
readonly default: {
readonly isInputAvailable: true;
readonly isOutputAvailable: true;
};
readonly none: {
readonly isInputAvailable: false;
readonly isOutputAvailable: false;
};
};
/**
* Audio Device Module API for controlling audio devices and settings.
* iOS/macOS only - will throw on Android.
*/
export declare class AudioDeviceModule {
/**
* Start audio playback
*/
static startPlayout(): Promise<void>;
/**
* Stop audio playback
*/
static stopPlayout(): Promise<void>;
/**
* Start audio recording
*/
static startRecording(): Promise<void>;
/**
* Stop audio recording
*/
static stopRecording(): Promise<void>;
/**
* Initialize and start local audio recording (calls initAndStartRecording)
*/
static startLocalRecording(): Promise<void>;
/**
* Stop local audio recording
*/
static stopLocalRecording(): Promise<void>;
/**
* Mute or unmute the microphone
*/
static setMicrophoneMuted(muted: boolean): Promise<void>;
/**
* Check if microphone is currently muted
*/
static isMicrophoneMuted(): boolean;
/**
* Enable or disable voice processing (requires engine restart)
*/
static setVoiceProcessingEnabled(enabled: boolean): Promise<void>;
/**
* Check if voice processing is enabled
*/
static isVoiceProcessingEnabled(): boolean;
/**
* Temporarily bypass voice processing without restarting the engine
*/
static setVoiceProcessingBypassed(bypassed: boolean): void;
/**
* Check if voice processing is currently bypassed
*/
static isVoiceProcessingBypassed(): boolean;
/**
* Enable or disable Automatic Gain Control (AGC)
*/
static setVoiceProcessingAGCEnabled(enabled: boolean): void;
/**
* Check if AGC is enabled
*/
static isVoiceProcessingAGCEnabled(): boolean;
/**
* Check if audio is currently playing
*/
static isPlaying(): boolean;
/**
* Check if audio is currently recording
*/
static isRecording(): boolean;
/**
* Check if the audio engine is running
*/
static isEngineRunning(): boolean;
/**
* Set the microphone mute mode
*/
static setMuteMode(mode: AudioEngineMuteMode): Promise<void>;
/**
* Get the current mute mode
*/
static getMuteMode(): AudioEngineMuteMode;
/**
* Enable or disable advanced audio ducking
*/
static setAdvancedDuckingEnabled(enabled: boolean): void;
/**
* Check if advanced ducking is enabled
*/
static isAdvancedDuckingEnabled(): boolean;
/**
* Set the audio ducking level (0-100)
*/
static setDuckingLevel(level: number): void;
/**
* Get the current ducking level
*/
static getDuckingLevel(): number;
/**
* Check if recording always prepared mode is enabled
*/
static isRecordingAlwaysPreparedMode(): boolean;
/**
* Enable or disable recording always prepared mode
*/
static setRecordingAlwaysPreparedMode(enabled: boolean): Promise<void>;
/**
* Get the current engine availability (input/output availability)
*/
static getEngineAvailability(): AudioEngineAvailability;
/**
* Set the engine availability (input/output availability)
*/
static setEngineAvailability(availability: AudioEngineAvailability): Promise<void>;
}