Chainlit / chainlit

Build Conversational AI in minutes ⚡️
https://docs.chainlit.io
Apache License 2.0
7.1k stars 931 forks source link

Microphone not starting when using `on_audio_chunk`. Console log shows the `userMedia` is undefined. How to make chainlit to ask for permission to use Microphone? #1295

Open ambiSk opened 2 months ago

ambiSk commented 2 months ago

Describe the bug I have been trying out audio ai from chainlit-cookbook/Audio-Assistant. I tried hosting it on localhost and also through HTTP protocol on a linux server. But I am getting undefined userMedia in my console logs, and Microphone doesn't shows up to record.

To Reproduce Run chainlit-cookbook/Audio-Assistant on linux server with OAuth enabled, and configured nginx to forward to certain domain.

  1. Go to link of the hosted UI
  2. Trying pressing the Microphone Icon in text box of chainlit, or Try pressing P
  3. Inspect and look at Console Log
  4. An Error will show up that userMedia is undefined

Expected behavior Asks for permission to use Microphone on this site and starts recording

Desktop (please complete the following information):

tituslhy commented 1 month ago

Upvoting this issue. I'm not sure why but this only works with localhost deployment. when it comes to actual deployment I somehow cannot click the mic.

puppetm4st3r commented 1 month ago

for mic usage you have to deploy over https if host is not localhost, you can create a self signed cert for private ip testing and install that cert on the testing machine to get the browser more relaxed on security blockings