52 lines
1.9 KiB
Markdown
52 lines
1.9 KiB
Markdown
# Voice Translator App
|
|
|
|
This app provides text translation, speech-to-text, and text-to-speech functionality. It runs an Express server and serves a single-page frontend.
|
|
|
|
HTTPS for microphone access
|
|
---------------------------------
|
|
Modern browsers require a secure context (HTTPS or localhost over HTTPS) for getUserMedia microphone access. This project can start an HTTPS server on `https://localhost:3443` using either your own certificate files or a generated self-signed certificate.
|
|
|
|
How to run
|
|
-----------
|
|
1. Install dependencies:
|
|
|
|
```bash
|
|
cd /Users/chadee/Ria
|
|
npm install
|
|
```
|
|
|
|
2. Start the server (HTTP + HTTPS):
|
|
|
|
```bash
|
|
npm start
|
|
```
|
|
|
|
This starts the HTTP server on `http://localhost:3000` and an HTTPS server on `https://localhost:3443`.
|
|
|
|
Using your own certificate
|
|
--------------------------
|
|
If you have SSL certificate and key files, set the following environment variables before starting the server:
|
|
|
|
```bash
|
|
export SSL_CERT_PATH=/path/to/cert.pem
|
|
export SSL_KEY_PATH=/path/to/key.pem
|
|
npm start
|
|
```
|
|
|
|
When no certificate is provided, the server generates a temporary self-signed certificate at runtime and serves HTTPS on `https://localhost:3443`.
|
|
|
|
Accepting the self-signed cert warning
|
|
------------------------------------
|
|
When using the generated self-signed certificate, your browser will show a security warning. To proceed:
|
|
|
|
- In Chrome/Edge/Brave: Click "Advanced" → "Proceed to localhost (unsafe)".
|
|
- In Firefox: Accept the risk and continue.
|
|
- In Safari: Go to System Settings → Privacy & Security → Certificates to trust the localhost certificate if needed.
|
|
|
|
After accepting the warning, open `https://localhost:3443` and allow microphone access when prompted. The site will run in a secure context and `getUserMedia` will work.
|
|
|
|
Notes
|
|
-----
|
|
- The server will log a warning when generating a temporary self-signed certificate.
|
|
- For production deployments use valid CA-signed certificates.
|