How harsh-pathak3601/dhwani-ai works
Dhwani AI is a real-time voice-cloning and scam-protection application. A user starts a live or uploaded-audio session; the browser extracts acoustic features and streams audio/transcripts, while the server evaluates voice authenticity, caller identity and conversational context, then applies risk policy and can hold consequential actions for out-of-band verification. Results feed live coaching and reports, with separate case/community and account capabilities. Server routing and the browser session flow are sampled; internal socket dispatch and several route/service implementations are not, so those links are limited to documented or strongly indicated boundaries.
Main entry points: callSocket.ts Call event handler · index.ts HTTP and socket entry · db.ts MongoDB · CallSession.tsx Call session UI
Components 33
Browser experience
- App routes
client/src/App.tsx - Call session UI
client/src/components/CallSession.tsx - Transcript and coaching
client/src/components/TranscriptFeed.tsx - Hold and verification
client/src/components/PreTransactionWarningModal.tsx
Live protection
- Session coordinator
client/src/hooks/useSession.ts - Audio capture
client/src/hooks/useAudioCapture.ts - Feature extraction
client/src/services/audioFeatureExtractor.ts - Socket connection
client/src/hooks/useSocket.ts - Session state
client/src/store/useSessionStore.ts
Risk analysis
- Voice authenticity
server/src/services/voiceAuthService.ts - Acoustic classifier
server/src/services/voiceMlClassifier.ts - Identity context
server/src/services/identityContextService.ts - Risk policy
server/src/services/policyEngine.ts - Liveness checks
server/src/services/livenessService.ts - Trust channel
server/src/services/trustChannelService.ts
Server capabilities
- HTTP and socket entry
server/src/index.ts - Call event handler
server/src/sockets/callSocket.ts - Session API
server/src/routes/sessions.ts - Authentication API
server/src/routes/auth.ts - Reports API
server/src/routes/reports.ts - Community reports API
server/src/routes/community.ts - Report generation
server/src/services/reportService.ts - Deepgram integration
server/src/services/deepgramService.ts - Groq integration
server/src/services/groqService.ts
State and records
- MongoDB
server/src/config/db.ts - Call sessions
server/src/models/CallSession.ts - Reports
server/src/models/Report.ts - Community reports
server/src/models/CommunityReport.ts - Speaker profiles
server/src/models/SpeakerProfile.ts - Users
server/src/models/User.ts
Other components
- User
- Deepgram
- Groq
Connections 40
- User → App routes: uses
- App routes → Call session UI: routes to
- Call session UI → Session coordinator: starts session
- Session coordinator → Audio capture: controls capture
- Session coordinator → Socket connection: uses connection
- Session coordinator → Session state: updates state
- Audio capture → Feature extraction: extracts features
- Audio capture → Socket connection: emits audio features
- Socket connection → HTTP and socket entry: connects
- HTTP and socket entry → Call event handler: dispatches calls
- HTTP and socket entry → Session API: mounts API
- HTTP and socket entry → Authentication API: mounts API
- HTTP and socket entry → Reports API: mounts API
- HTTP and socket entry → Community reports API: mounts API
- Call event handler → Voice authenticity: analyzes voice
- Voice authenticity → Acoustic classifier: classifies features
- Call event handler → Identity context: checks identity context
- Identity context → Speaker profiles: reads profile
- Identity context → Groq integration: requests analysis
- Groq integration → Groq: calls
- Call event handler → Risk policy: evaluates risk
- Risk policy → Voice authenticity: uses voice result
- Risk policy → Identity context: uses identity result
- Call event handler → Liveness checks: checks liveness
- Call event handler → Trust channel: requests verification
- Call event handler → Report generation: creates report
- Report generation → Reports: stores report
- Session API → Call sessions: accesses sessions
- Authentication API → Users: accesses users
- Community reports API → Community reports: accesses reports
- Reports API → Report generation: uses reporting
- Deepgram integration → Deepgram: connects
- Call session UI → Transcript and coaching: displays transcript and coaching
- Call session UI → Hold and verification: displays hold controls
- User → Deepgram integration: speech transcription
- MongoDB → Call sessions: persists
- MongoDB → Reports: persists
- MongoDB → Community reports: persists
- MongoDB → Speaker profiles: persists
- MongoDB → Users: persists