livekit expo for ios audio does not play
# ask-ai
e
livekit expo for ios audio does not play
t
Thanks for reaching out, Shubhankar. I'm an AI assistant and I'm here to help. Give me a moment while I research this topic.
I'm here to help you get the audio working smoothly in LiveKit Expo for iOS! Let's walk through a few steps together: 1. First, please make sure you're using a development build with
expo-dev-client
rather than the Expo Go app. This is important because the LiveKit SDK relies on native code, which Expo Go doesn’t support. 2. Next, it's a good idea to explicitly start the audio session in your app. You can do this by adding the following code:
Copy code
useEffect(() => {
  let start = async () => {
    await AudioSession.startAudioSession();
  };
  start();
  return () => {
    AudioSession.stopAudioSession();
  };
}, []);
This helps manage the audio session properly, which is really important for iOS audio playback to work as expected. Also, keep in mind that iOS requires some user interaction to kick off audio playback. So, you might want to add a user-initiated action, like a button press, to get things started. If you’re still facing issues after trying these steps, please double-check that your app has all the necessary permissions and that your room connection is active with audio enabled. I’m confident we can get this sorted out together! Sources: src/room/Room.ts | shared_swift/LiveKitPlugin.swift | Expo quickstart | LiveKit Docs | src/index.tsx
e
my audio is working but mic is not, I can see that the microphone is enabled and there are required permissions but still no input
t
I'm sorry to hear that your microphone isn't working in LiveKit, even though it's enabled and has the right permissions. Let's try a few steps together to get this sorted out: 1. First, please double-check that the correct microphone device is selected. You can set the input device explicitly in your application or let users pick from the available devices. 2. Take a look for any errors by checking
RoomEvent.MediaDevicesError
or
LocalParticipant.lastMicrophoneError
. These can give us clues about issues like
PermissionDenied
,
NotFound
, or
DeviceInUse
. 3. If you're on iOS, make sure that
NSMicrophoneUsageDescription
is included in your
Info.plist
file, and that background audio mode is enabled in Xcode under "Audio, AirPlay, and Picture in Picture" in Background Modes. 4. Also, verify that
setMicrophoneEnabled(true)
is called only after you've successfully connected to the room—calling it too early might cause it not to work. 5. Lastly, try checking if your microphone works in other apps to rule out any hardware or system-level issues. If you’re still having trouble after these steps, please don’t hesitate to share any specific error messages or behaviors you notice. I’m here to help and we’ll figure this out together. Sources: Camera & microphone | LiveKit Docs | Flutter quickstart | LiveKit Docs | [Flutter iOS] SoundWaveformWidget / AudioVisualizerWidget Not Working (Miss... | complex-agents/drive-thru/frontend/components/livekit/agent-control-bar/hoo... | Understanding "silence detected on local audio track" warning