Express microservice that turns the engineβs fileInfo, analysis, and
userContext payloads into actionable mix guidance using OpenAIβs Responses
API. It shares the same tooling and auth patterns as the other services.
POST /feedbackendpoint protected byx-api-key- Health endpoint (
GET /health) - Zod validation + typed service interface
- Vitest coverage for service + router layers
- ESLint/Prettier/TypeScript toolchain aligned with the rest of the repo
src/
ββ app.ts # Express composition
ββ config/env.ts # zod-validated env loader
ββ index.ts # bootstrap entrypoint
ββ middleware/api-key-auth.ts # auth middleware
ββ routes/feedback.ts # POST /feedback
ββ services/audio-feedback-service.ts
- Node.js β₯ 18
- OpenAI API access (
OPENAI_API_KEY) - The API/engine must send the analysis payload; this service does not re-fetch metadata/analysis itself
npm install
npm run devScripts mirror the other services: dev, build, start, typecheck,
lint, format, test, and generate:api-key.
npm run generate:api-key # update AUDIO_FEEDBACK_API_KEY locally
cd ../api && npm run metadata:api-key # reuse sync script patterns if desired| Variable | Description |
|---|---|
PORT |
HTTP port (default 4003) |
AUDIO_FEEDBACK_API_KEY |
Shared secret used for x-api-key auth |
OPENAI_API_KEY |
Token used by the OpenAI client |
OPENAI_MODEL |
Model ID (defaults to gpt-4.1-mini) |
OPENAI_BASE_URL |
Optional custom base URL/proxy |
.env and .env.example contain the defaults.
curl -X POST http://localhost:4003/feedback \
-H 'Content-Type: application/json' \
-H 'x-api-key: super-secret-feedback-key' \
-d '{
"fileInfo": { "durationSec": 210, "format": "wav", "sampleRate": 48000, "channels": 2 },
"analysis": { "loudness": { "integratedLUFS": -9.5, "truePeak": -0.7, "loudnessRange": 6 } },
"userContext": { "genre": "house", "experienceLevel": "intermediate" }
}'Response:
{
"feedbackText": "Overall your mix is punchy but could breathe more in the chorus...",
"suggestions": [
"Lower overall loudness by ~1 dB to avoid clips on streaming platforms.",
"Tighten low-mids around 300 Hz to make space for vocals.",
"Automate stereo widening so the chorus feels wider than the verse."
]
}See CODE OF CONDUCT, CONTRIBUTING, and SECURITY docs. Pull requests should
pass npm run lint, npm run typecheck, and npm test.