LocalAudioStream interface
extends AudioStream LOCAL
Your microphone stream. Adds device control and silence detection. Access via room.localParticipant.audio after publishAudio(). Frame processors are managed globally via VideoSDK.applyAudioProcessor() โ not on the stream.
Blueprint
Members added on top of AudioStream.
setVolume / audioLevel here โ those live on RemoteAudioStream. You don't control the volume of your own outgoing mic at the SDK level. For local-side speaking-level UI, use getStats() or compute via Web Audio analyser through getMediaStreamTrack().Properties (added)
Plus inherited from AudioStream: id, codec, isPlaying, isMuted, isEnded.
inputDevice
Currently selected microphone as a MicrophoneDeviceInfo (combines deviceId, groupId, label). Use me.audio.inputDevice.label for "Mic: X" UI; me.audio.inputDevice.deviceId for storage / comparison.
Methods (added)
Plus inherited from AudioStream: attach / detach, getStats, getMediaStreamTrack.
setInputDevice async
Hot-swap to a different microphone. Stream instance preserved; SDK swaps the underlying track. Strongly typed โ passing a CameraDeviceInfo or SpeakerDeviceInfo is a compile-time error.
const mics = await VideoSDK.getMicrophones();
const headset = mics.find(m => m.label.includes('Headset'));
await me.audio.setInputDevice(headset);
VideoSDK.applyAudioProcessor() to apply a frame transform. It survives publish, unpublish, re-publish, and setInputDevice swaps. No per-stream setProcessor method.getInputCapabilities async
Reports what the current mic can do โ sample rates, channel counts, etc.
stop async PRE-CALL
Aborts a pre-call preview stream. Releases the underlying microphone and clears the VideoSDK.audioStream singleton slot. After stop(), all methods on this instance throw STREAM_STOPPED.
me.audio, use me.unpublishAudio() instead โ it does full teardown (unpublish + release device).Related open questions: Q18 โ Pre-call preview lifecycle (singleton vs render-only)
Events
There are no publish/unpublish events on LocalParticipant โ the publishAudio Promise delivers the stream directly.
| Event | Payload | When |
|---|---|---|
silent-detected | { timestamp: number } | Local mic gone silent (hardware mute, dead device, mic permission revoked, OS sleep). |
ended | { timestamp: number } | Mic source ended โ device unplugged, OS revoked permission, browser tab lost device access. |
No paired active event โ silence is the abnormal state worth flagging; "active" is the default and not interesting to notify on.
frozen / stuck) are scoped to RemoteVideoStream only. RemoteAudioStream exposes a single state-changed event for routing transitions (active / paused / ended).await me.publishAudio({ deviceId: 'default', noiseSuppression: true });
me.audio.on('silent-detected', ({ timestamp }) => {
showToast("Your microphone isn't picking up sound. Check that it's not muted on your device.");
});
See also: AudioStream LocalParticipant AudioFrameProcessor RemoteAudioStream