You are currently viewing the React version of this page. Use the dropdown to the right to customize this page for your client framework.
Bot audio output
Drop No props required. Just make sure it lives inside the provider.
PipecatClientAudio inside your PipecatClientProvider and it handles everything — it mounts a hidden <audio> element and wires up the bot’s audio track automatically:Microphone
Enabling and muting
Set
enableMic: true in the constructor to start the session with the mic active. This is the default:Use Or use the headless
usePipecatClientMicControl to mute and unmute within a component:PipecatClientMicToggle component, which provides the same state via a render prop.Switching microphones
usePipecatClientMediaDevices gives you a reactive device list and setters:Camera
Camera is disabled by default. Enable it in the constructor:
Not all transports support video.
enableCam has no effect on transports that
don’t support it (e.g. WebSocket).Use Use
usePipecatClientCamControl to toggle the camera, and PipecatClientVideo to render the feed:participant="bot" to render the bot’s video feed instead. Switch cameras via availableCams / updateCam from usePipecatClientMediaDevices.Speakers
Enumerate and switch output devices via
usePipecatClientMediaDevices:Device initialization before connecting
By default, device access is requested whenconnect() is called. If you want to enumerate or test devices before the session starts — for example, to show a device picker pre-call — call initDevices() first:
Media tracks
For advanced use cases — custom rendering, audio processing, recording — you can access the rawMediaStreamTrack objects directly.
Audio visualization
The React SDK includes Set
VoiceVisualizer, a canvas-based component that renders audio level bars for any participant:participantType="bot" to visualize the bot’s audio instead.API reference
Client Methods — Devices
initDevices, getAllMics, enableMic, and moreReact Hooks
usePipecatClientMediaDevices, usePipecatClientMicControl, usePipecatClientCamControl, usePipecatClientMediaTrackReact Components
PipecatClientAudio, PipecatClientVideo, PipecatClientMicToggle, PipecatClientCamToggle, VoiceVisualizer