# Hearbit AI 🦉🎙️

**Hearbit AI** is your professional meeting assistant for macOS. It records both your microphone and system audio (e.g., Teams, Zoom), transcribes it with high precision using Infomaniak's Whisper API, and generates intelligent, structured summaries.

![App Icon](src-tauri/icons/128x128@2x.png)

## ✨ New in v1.2.0

*   **🎧 Native System Audio**: No more BlackHole driver needed! Captures Teams/Zoom audio directly and securely via macOS ScreenCaptureKit.
*   **🔁 Auto-Loop (Standby Mode)**: The app automatically "re-arms" after a call finishes. Just leave it running—it will wake up, record your next call, and go back to sleep.
*   **⚡ Smart VAD & Pre-Roll**:
    *   **3-Second Pre-Roll**: Catches the start of the sentence even if you speak before the trigger.
    *   **Noise Filtering**: Ignores typing and background noise.
*   **🛡️ Empty Audio Guard**: Automatically discards silent recordings (e.g., false triggers) to save API costs and prevent errors.
*   **✨ 48kHz Crystal Clear Audio**: Optimized audio pipeline prevents "robot voice" distortion.

## 🚀 Key Features

*   **🎙️ Dual-Channel Recording**: Seamlessly capture your voice and meeting audio.
*   **📁 Import Audio Files**: Upload existing recordings (MP3, WAV, M4A, etc.).
*   **⏱️ Long Meeting Support**: Handles meetings 2+ hours with automatic chunking.
*   **📅 Microsoft 365 Integration**: View upcoming meetings and join with one click.
*   **💾 Persistent History**: Automatically saves all transcripts and summaries locally.
*   **✉️ Email Summaries**: Send formatted HTML summaries via your own SMTP server.
*   **🎨 White-Labeling**: Upload your custom company logo.

---

## 🛠️ Usage Guide

### 1. Installation
1.  Download the latest `.dmg` file from the [Releases page](#).
2.  Open the `.dmg` and drag **Hearbit AI** to your Applications folder.
3.  **Permission Check**: On first launch, grant "Screen Recording" permission (required for capturing System Audio).

### 2. Configuration
1.  Click **Settings** (gear icon).
2.  Enter your **Infomaniak API Key** and **Product ID**.
3.  (Optional) Configure **SMTP** for email sending and **Microsoft 365** for calendar integration.

### 3. Recording a Meeting
1.  **Select Mode**: Choose "Meeting" (captures Mic + System) or "Voice Memo" (Mic only).
2.  **Auto-Start (Recommended)**: Check "Auto-start when audio detected".
3.  **Standby**: Click "Standby (Auto-Start)". The app waits silently.
4.  **Join Call**: Join your Teams/Zoom call.
5.  **Trigger**: As soon as someone speaks, Hearbit starts recording automatically.
6.  **Finish**: When the call ends (silence > 20s), Hearbit stops, transcribes, summarizes, and **goes back to Standby** for the next call.

### 4. Customizing Prompts
You can create custom AI templates in Settings -> Prompts. Example:
*   **"Sales Call"**: Focus on budget, timeline, and decision makers.
*   **"Daily Standup"**: Extract blockers and next steps.
*   **"General Protocol"**: Standard meeting minutes.

---

## ❓ Troubleshooting

### "Hearbit AI is damaged and can't be opened"
If macOS blocks the app because it's not notarized:
1.  Open **Terminal**.
2.  Run: `sudo xattr -cr /Applications/Hearbit\ AI.app`
3.  Enter your password and try again.

### Audio cuts off at the start?
v1.2.0 includes a **3-second buffer**. If this persists, ensure your "Auto-start" threshold isn't too high (though it's currently auto-calibrated).

### "Batch processing failed"
This means the audio was empty or too short. The new **Empty Guard** prevents this in most cases. If it happens, check your microphone selection.

---

## 👨‍💻 Development

Built with **Tauri v2**, **React**, and **TypeScript**.

### Setup
```bash
npm install
```

### Run Locally
```bash
npm run tauri dev
```

### Build for Production
```bash
npm run tauri build
```

---

## 📄 License
Property of Livtec. All rights reserved.
