A modern React TypeScript application for recording and analyzing heart sounds, featuring patient management, audio signal processing, and multi-language support.
- Patient Management: Add, edit, delete, and manage patient information
- Audio Recording: 60-second heart sound recording with real-time timer
- Signal Processing: Advanced digital signal processing with bandpass filtering (10-100Hz)
- Waveform Visualization: Interactive chart display using Recharts
- Doctor's Notes: Save and manage clinical observations for each patient
- Data Import/Export: Export patient data as medical reports (TXT) and JSON backups
- Multi-language Support: English and German (Deutsch)
- Data Persistence: LocalStorage for patient data across sessions
- React 18 with TypeScript
- Vite for fast development and building
- Material-UI (MUI) for modern UI components
- Recharts for data visualization
- Context API for state management
- MediaRecorder API for audio recording
src/
├── App.tsx # Main application component
├── main.tsx # Application entry point
├── contexts/
│ ├── PatientContext.tsx # Patient data & state management
│ └── LanguageContext.tsx # Internationalization
├── components/
│ ├── Sidebar/
│ │ ├── Sidebar.tsx # Main sidebar container
│ │ ├── PatientList.tsx # Patient list with status indicators
│ │ ├── PatientInfo.tsx # Patient information form
│ │ └── DataManagement.tsx # Import/Export controls
│ ├── MainPanel/
│ │ ├── MainPanel.tsx # Main content container
│ │ ├── RecordingControls.tsx # Audio recording controls
│ │ ├── WaveformChart.tsx # Heart sound waveform chart
│ │ └── NotesSection.tsx # Doctor's notes editor
│ └── Modals/
│ ├── AddPatientModal.tsx # New patient dialog
│ └── ConfirmationModal.tsx # Unsaved changes warning
├── hooks/
│ ├── useAudioRecorder.ts # Audio recording hook
│ └── useLocalStorage.ts # LocalStorage sync hook
├── utils/
│ ├── audioProcessing.ts # Signal processing utilities
│ └── dataExport.ts # Export/import utilities
├── types/
│ └── index.ts # TypeScript type definitions
└── i18n/
└── translations.ts # Language translations
- Node.js (v16 or higher)
- npm or yarn
- Install dependencies:
npm install- Start the development server:
npm run dev- Open your browser to
http://localhost:5173
npm run buildThe production-ready files will be in the dist/ directory.
npm run preview- Click "Add Patient" button in the sidebar
- Enter patient name (required), age, and sex
- Click "Add Patient" to save
- Select a patient from the list
- Click "Start Recording" button
- Recording automatically stops after 60 seconds
- Audio file is automatically downloaded
- Waveform is displayed in the chart
- Select a patient
- Enter clinical observations in the notes section
- Click "Save Notes" to persist changes
- Notes status indicator shows saved/modified state
- Export Patient: Export current patient's data as TXT report and JSON backup
- Export All: Export all patients as combined report and JSON backup
- Click "Import Data"
- Select a JSON backup file
- Confirm import (will merge with existing data)
The application uses advanced signal processing techniques:
- DC Offset Removal: Centers the signal around zero
- Zero-Phase Bandpass Filter: 10-100Hz range for heart sounds
- Hanning Window: Reduces edge artifacts
- Segment Extraction: Analyzes 30-40 second segment (10 seconds displayed)
- Downsampling: Reduces data points for efficient visualization
- Chrome/Edge (recommended)
- Firefox
- Safari (with getUserMedia support)
Note: Requires HTTPS or localhost for microphone access.
Patient data (excluding audio waveforms) is automatically saved to browser LocalStorage:
- Patient information (name, age, sex)
- Doctor's notes
- Recording timestamps
- Last modified dates
This application is a complete refactor of the original standalone HTML file, now built with:
- Modern React architecture with TypeScript
- Component-based design
- Context API for state management
- Material-UI for consistent design system
- Recharts for improved data visualization
- Better code organization and maintainability
ISC
Heart Audio Recorder Development Team