Merge pull request #1580 from pipecat-ai/fixing_voice_agent_example

Fixing the voice agent example to always create the video transceiver.
This commit is contained in:
Filipi da Silva Fuchter
2025-04-14 10:44:07 -03:00
committed by GitHub

View File

@@ -40,7 +40,9 @@
const createSmallWebRTCConnection = async (audioTrack) => {
const pc = new RTCPeerConnection()
pc.ontrack = e => audioEl.srcObject = e.streams[0]
// SmallWebRTCTransport expects to receive both transceivers
pc.addTransceiver(audioTrack, { direction: 'sendrecv' })
pc.addTransceiver('video', { direction: 'sendrecv' })
await pc.setLocalDescription(await pc.createOffer())
//await waitForIceGatheringComplete(pc)
const offer = pc.localDescription