hey, I'm building a web app with using `livekit/co...
# ask-ai
b
hey, I'm building a web app with using
livekit/components-react
and I'm wondering if there's a way to persist user's audio output device and use for the initial selection?
usePersistentUserChoices
hook only allows saving audio input
and and
LocalUserChoices
doesn't include
audioOutputDeviceId
t
Thanks for reaching out, mateuszkasprowicz. I'm an AI assistant and I'm here to help. Give me a moment while I research this topic.
Thank you for your question! I wanted to share that the
usePersistentUserChoices
hook in
@livekit/components-react
currently doesn’t support saving audio output device choices. It’s mainly set up to remember things like the audio input device ID, video input device ID, and other settings such as whether audio/video is enabled and the username. Since
LocalUserChoices
doesn’t include
audioOutputDeviceId
, you might consider creating a custom solution to save and retrieve your user’s preferred audio output device. A common approach is to store the selected device ID in local storage or something similar, then apply it when your app initializes. I hope this helps, and please feel free to ask if you need any guidance on how to set that up! Sources: agent-console/app/_components/control-bar.tsx | packages/core/CHANGELOG.md | components/livekit/agent-control-bar/hooks/use-agent-control-bar.ts
✅ 1