691 B
691 B
Frontend to test /chat endpoint. Uses the browser MediaRecorder API to record audio and POST to the middleware.
Run locally:
- Install dependencies
cd frontend
npm install
- Start dev server
npm run dev
- Open http://localhost:3000 in the browser and press/hold the record button. The app will POST the recorded audio to
http://localhost:8000/chatand play the returned audio.
Notes:
- This simple client posts a
webmaudio blob (from MediaRecorder). The backend must acceptwebmor you can adapt the client to encode WAV. - If the backend runs on a different origin make sure to enable CORS on the middleware (FastAPI) or run the frontend proxied.