cogentapps / chat-with-gpt

An open-source ChatGPT app with a voice
https://www.chatwithgpt.ai
MIT License
2.3k stars 489 forks source link

Sorry, an error occured trying to record audio. #132

Open trialskid opened 1 year ago

trialskid commented 1 year ago

I am unable to record audio. Ive tried on my PC, mac and iphone

Running docker on an Unraid server

image
cogentapps commented 1 year ago

Most likely because many browsers block audio recording on 'insecure' connections (no SSL, no lock icon in the URL bar) and the Docker command doesn't use SSL by default. You can try this in your config.yaml:

tls:
  selfSigned: true

to enable SSL, and access https://localhost:3000.

This is an undocumented feature because it's not well-tested yet and may not work.

Vuthric commented 1 year ago

Just got this working. A little elaborated steps to enable selfSigned:

1) You need a legit SSL certificate, the easiest way is to follow https://github.com/acmesh-official/acme.sh

2) once you have the certificate key and cert files. Modify config.yaml as cogentapps said, but you also have to add the file paths

#### This session only exists if you are saving the keys on the server ####
services:
  openai:
    apiKey: sk-**************
  elevenlabs:
    apiKey: *************

#### Add this ####
tls:
  selfSigned: true
  key: /app/tls/yourwebsite.com.key.pem
  cert: /app/tls/certs/yourwebsite.com.cert.pem

3) Obviously the /app/tls/ path doesn't exist yet. You need to mount it to the path where acme.sh installed the cert in step 2) e.g. sudo docker run -d -v /home/username/data:/app/data -v /path/to/cert:/app/tls -p 3000:3000 chat:latest