Speakr is a personal, self-hosted web application designed for transcribing audio recordings
Python
updated readme and diarize switch
Murtaza Nasirb169abd91d46
diff --git a/README.md b/README.mdindex cfd9db84..b195271d 100644--- a/README.md+++ b/README.md@@ -6,16 +6,97 @@ This project is dual-licensed. See the [License](#license) section for details.Speakr is a personal, self-hosted web application designed for transcribing audio recordings (like meetings), generating concise summaries and titles, and interacting with the content through a chat interface. Keep all your meeting notes and insights securely on your own server.-## Screenshots----+<div style="display: flex; justify-content: center; gap: 10px; flex-wrap: wrap;">+ <img src="static/img/hero-shot.png" alt="Hero Shot" style="max-width: 48%; height: auto;"/>+ <img src="static/img/multilingual-support.png" alt="Multilingual Support" style="max-width: 48%; height: auto;"/>+</div>++## Features Showcase++<details>+<summary><strong>Transcription and Chat</strong></summary>+<div style="display: flex; justify-content: center;">+ <figure>+ <img src="static/img/transcription-chat-bubble-view.png" alt="Transcription and Chat" width="400"/>+ <figcaption style="text-align: center;">Integrated Chat</figcaption>+ </figure>+</div>+</details>++<details>+<summary><strong>Light and Dark Mode</strong></summary>+<div style="display: flex; justify-content: space-around;">+ <figure>+ <img src="static/img/light-mode.png" alt="Light Mode" width="400"/>+ <figcaption style="text-align: center;">Light Mode</figcaption>+ </figure>+ <figure>+ <img src="static/img/dark-mode.png" alt="Dark Mode" width="400"/>+ <figcaption style="text-align: center;">Dark Mode</figcaption>+ </figure>+</div>+</details>++<details>+<summary><strong>Intuitive Transcription Views</strong></summary>+<div style="display: flex; justify-content: space-around; flex-wrap: wrap;">+ <figure>+ <img src="static/img/simple-transcription-view.png" alt="Simple Transcription View" width="400"/>+ <figcaption style="text-align: center;">Simple View</figcaption>+ </figure>+ <figure>+ <img src="static/img/transcription-bubble-view.png" alt="Bubble View" width="400"/>+ <figcaption style="text-align: center;">Bubble View</figcaption>+ </figure>+</div>+</details>++<details>+<summary><strong>Speaker Identification</strong></summary>+<div style="display: flex; justify-content: space-around; flex-wrap: wrap;">+ <figure>+ <img src="static/img/intuitive-speaker-identification.png" alt="Intuitive Speaker Identification" width="400"/>+ <figcaption style="text-align: center;">AI-Assisted Identification</figcaption>+ </figure>+ <figure>+ <img src="static/img/manual-auto-speaker-identification.png" alt="Manual and Auto Speaker ID" width="400"/>+ <figcaption style="text-align: center;">Manual & Auto Options</figcaption>+ </figure>+ <figure>+ <img src="static/img/speaker-suggestions.png" alt="Speaker Suggestions" width="400"/>+ <figcaption style="text-align: center;">Saved Speaker Suggestions</figcaption>+ </figure>+</div>+</details>++<details>+<summary><strong>ASR and API Options</strong></summary>+<div style="display: flex; justify-content: space-around; flex-wrap: wrap;">+ <figure>+ <img src="static/img/transcription-with-asr.png" alt="Transcription with ASR" width="400"/>+ <figcaption style="text-align: center;">With ASR Webservice</figcaption>+ </figure>+ <figure>+ <img src="static/img/transcription-without-asr.png" alt="Transcription without ASR" width="400"/>+ <figcaption style="text-align: center;">With OpenAI-Compatible API</figcaption>+ </figure>+</div>+</details>++<details>+<summary><strong>Advanced Features</strong></summary>+<div style="display: flex; justify-content: space-around; flex-wrap: wrap;">+ <figure>+ <img src="static/img/reprocessing-transcript.png" alt="Reprocessing Transcript" width="400"/>+ <figcaption style="text-align: center;">Reprocess with New Settings</figcaption>+ </figure>+</div>+</details>## What's New?* **Simplified Docker Setup:** Configuration is now managed via a single `.env` file, making setup faster and easier.-* **ASR Webservice Integration:** Added support for a powerful ASR (Automatic Speech Recognition) webservice.+* **Advanced ASR Integration:** Added support for ASR endpoints using the [`onerahmet/openai-whisper-asr-webservice`](https://github.com/ahmetoner/whisper-asr-webservice) package. This integration is necessary for the speaker diarization feature.* **Speaker Diarization:** Identify and label different speakers in your recordings. **Note: This feature requires the ASR Webservice method with the `whisperx` engine.*** **Transcription Reprocessing:** A new "Reprocess" button allows you to re-run transcription with different settings (e.g., to add diarization).* **Speaker Identification:** A new modal helps you name speakers, with highlighting for clarity. You can also automatically identify speakers using an LLM.@@ -170,6 +251,8 @@ services:restart: unless-stopped```+**A Note on Diarization Accuracy:** For best results, it is often better to set the number of speakers slightly higher (e.g., by 1-2) than the actual number present. You can easily merge speakers later in the speaker identification modal.+Speakr has been tested with the recommended `onerahmet/openai-whisper-asr-webservice` image. Other ASR webservices might work but have not been tested. For more information on the recommended service and its various configurations, please see the official resources.## Usage Guide@@ -215,6 +298,13 @@ This project is **dual-licensed**:**You must choose one of these licenses** under which to use, modify, or distribute this software. If you are using or distributing the software without a commercial license agreement, you must adhere to the terms of the AGPLv3.+## Roadmap++Speakr is actively being developed. Future planned features include:++* **Quick Language Switching:** A faster way to change transcription or output languages on the fly.+* **Large File Chunking:** Automatic splitting of large audio files to support transcription endpoints with file size limits (like OpenAI's 25MB limit).+## ContributingWhile direct code contributions are not the primary focus at this stage, feedback, bug reports, and feature suggestions are highly valuable! Please feel free to open an Issue on the GitHub repository.diff --git a/app.py b/app.pyindex 36349b40..e4853024 100644--- a/app.py+++ b/app.py@@ -445,9 +445,13 @@ def transcribe_audio_task(app_context, recording_id, filepath, original_filenameif USE_ASR_ENDPOINT:with app_context:recording = db.session.get(Recording, recording_id)- user_diarize = recording.owner.diarize if recording.owner else False+ # Environment variable ASR_DIARIZE overrides user setting+ if 'ASR_DIARIZE' in os.environ:+ diarize_setting = ASR_DIARIZE+ else:+ diarize_setting = recording.owner.diarize if recording.owner else Falseuser_transcription_language = recording.owner.transcription_language if recording.owner else None- transcribe_audio_asr(app_context, recording_id, filepath, original_filename, language=user_transcription_language, diarize=user_diarize)+ transcribe_audio_asr(app_context, recording_id, filepath, original_filename, language=user_transcription_language, diarize=diarize_setting)returnwith app_context: # Need app context for db operations in thread@@ -1001,11 +1005,15 @@ def reprocess_transcription(recording_id):language = data.get('language') or (recording.owner.transcription_language if recording.owner else None)min_speakers = data.get('min_speakers')max_speakers = data.get('max_speakers')- user_diarize = recording.owner.diarize if recording.owner else ASR_DIARIZE+ # Environment variable ASR_DIARIZE overrides user setting+ if 'ASR_DIARIZE' in os.environ:+ diarize_setting = ASR_DIARIZE+ else:+ diarize_setting = recording.owner.diarize if recording.owner else Falsethread = threading.Thread(target=transcribe_audio_asr,- args=(app.app_context(), recording.id, recording.audio_path, recording.original_filename or f"Recording {recording.id}", language, user_diarize, min_speakers, max_speakers)+ args=(app.app_context(), recording.id, recording.audio_path, recording.original_filename or f"Recording {recording.id}", language, diarize_setting, min_speakers, max_speakers))else:app.logger.info(f"Using standard transcription API for reprocessing recording {recording_id}")@@ -1334,7 +1342,6 @@ def account():user_name = request.form.get('user_name')user_job_title = request.form.get('user_job_title')user_company = request.form.get('user_company')- diarize = 'diarize' in request.formcurrent_user.transcription_language = transcription_lang if transcription_lang else Nonecurrent_user.output_language = output_lang if output_lang else None@@ -1342,14 +1349,25 @@ def account():current_user.name = user_name if user_name else Nonecurrent_user.job_title = user_job_title if user_job_title else Nonecurrent_user.company = user_company if user_company else None- current_user.diarize = diarize++ # Only update diarize if it's not locked by env var+ if 'ASR_DIARIZE' not in os.environ:+ current_user.diarize = 'diarize' in request.formdb.session.commit()flash('Account details updated successfully!', 'success')return redirect(url_for('account'))default_summary_prompt_text = """Identify the key issues discussed. First, give me minutes. Then, give me the key issues discussed. Then, any key takeaways. Then, key next steps. Then, all important things that I didn't ask for but that need to be recorded. Make sure every important nuance is covered."""- return render_template('account.html', title='Account', default_summary_prompt_text=default_summary_prompt_text)++ asr_diarize_locked = 'ASR_DIARIZE' in os.environ++ return render_template('account.html',+ title='Account',+ default_summary_prompt_text=default_summary_prompt_text,+ use_asr_endpoint=USE_ASR_ENDPOINT,+ asr_diarize_locked=asr_diarize_locked,+ asr_diarize_env_value=ASR_DIARIZE)@app.route('/change_password', methods=['POST'])@login_requireddiff --git a/static/img/dark-mode.png b/static/img/dark-mode.pngnew file mode 100644index 00000000..459af1dfBinary files /dev/null and b/static/img/dark-mode.png differdiff --git a/static/img/hero-shot.png b/static/img/hero-shot.pngnew file mode 100644index 00000000..cbdb277bBinary files /dev/null and b/static/img/hero-shot.png differdiff --git a/static/img/intuitive-speaker-identification.png b/static/img/intuitive-speaker-identification.pngnew file mode 100644index 00000000..af32cbe5Binary files /dev/null and b/static/img/intuitive-speaker-identification.png differdiff --git a/static/img/light-mode.png b/static/img/light-mode.pngnew file mode 100644index 00000000..33291dd1Binary files /dev/null and b/static/img/light-mode.png differdiff --git a/static/img/manual-auto-speaker-identification.png b/static/img/manual-auto-speaker-identification.pngnew file mode 100644index 00000000..c45b5d88Binary files /dev/null and b/static/img/manual-auto-speaker-identification.png differdiff --git a/static/img/multilingual-support.png b/static/img/multilingual-support.pngnew file mode 100644index 00000000..482a6106Binary files /dev/null and b/static/img/multilingual-support.png differdiff --git a/static/img/reprocessing-transcript.png b/static/img/reprocessing-transcript.pngnew file mode 100644index 00000000..beafb5a1Binary files /dev/null and b/static/img/reprocessing-transcript.png differdiff --git a/static/img/simple-transcription-view-2.png b/static/img/simple-transcription-view-2.pngnew file mode 100644index 00000000..21386fd2Binary files /dev/null and b/static/img/simple-transcription-view-2.png differdiff --git a/static/img/simple-transcription-view.png b/static/img/simple-transcription-view.pngnew file mode 100644index 00000000..8f019be1Binary files /dev/null and b/static/img/simple-transcription-view.png differdiff --git a/static/img/speaker-suggestions.png b/static/img/speaker-suggestions.pngnew file mode 100644index 00000000..ef46b180Binary files /dev/null and b/static/img/speaker-suggestions.png differdiff --git a/static/img/transcription-bubble-view.png b/static/img/transcription-bubble-view.pngnew file mode 100644index 00000000..e33c7033Binary files /dev/null and b/static/img/transcription-bubble-view.png differdiff --git a/static/img/transcription-chat-bubble-view.png b/static/img/transcription-chat-bubble-view.pngnew file mode 100644index 00000000..0b3c178aBinary files /dev/null and b/static/img/transcription-chat-bubble-view.png differdiff --git a/static/img/transcription-with-asr.png b/static/img/transcription-with-asr.pngnew file mode 100644index 00000000..612478deBinary files /dev/null and b/static/img/transcription-with-asr.png differdiff --git a/static/img/transcription-without-asr.png b/static/img/transcription-without-asr.pngnew file mode 100644index 00000000..c7962b98Binary files /dev/null and b/static/img/transcription-without-asr.png differdiff --git a/templates/account.html b/templates/account.htmlindex 4abdf70b..cfaab586 100644--- a/templates/account.html+++ b/templates/account.html@@ -189,13 +189,27 @@<textarea name="summary_prompt" id="summary_prompt" rows="6" placeholder="Describe how you want your summaries structured. Leave blank to use the default prompt." class="mt-1 block w-full px-3 py-2 border border-[var(--border-secondary)] rounded-md shadow-sm focus:outline-none focus:ring-[var(--border-focus)] focus:border-[var(--border-focus)] sm:text-sm bg-[var(--bg-input)] text-[var(--text-primary)]">{{ current_user.summary_prompt or default_summary_prompt_text }}</textarea><p class="text-xs text-[var(--text-light)] mt-1">This prompt will be used to generate the summary for your transcriptions. You can use placeholders like {{transcription}} and {{language_directive}} if needed, though the system will try to intelligently place the transcription content.</p></div>+ {% if use_asr_endpoint %}<div><label for="diarize" class="flex items-center text-sm font-medium text-[var(--text-muted)]">- <input type="checkbox" name="diarize" id="diarize" class="h-4 w-4 rounded border-gray-300 text-blue-600 focus:ring-blue-500" {% if current_user.diarize %}checked{% endif %}>+ <input type="checkbox" name="diarize" id="diarize" class="h-4 w-4 rounded border-gray-300 text-blue-600 focus:ring-blue-500"+ {% if asr_diarize_locked %}+ disabled+ {% if asr_diarize_env_value %}checked{% endif %}+ {% else %}+ {% if current_user.diarize %}checked{% endif %}+ {% endif %}><span class="ml-2">Enable Diarization</span></label>- <p class="text-xs text-[var(--text-light)] mt-1">When using the ASR endpoint, this will enable speaker diarization.</p>+ <p class="text-xs text-[var(--text-light)] mt-1">+ When using the ASR endpoint, this will enable speaker diarization.+ {% if asr_diarize_locked %}+ <br>+ <strong class="text-[var(--text-warn-strong)]">This setting is currently locked by the environment variable <code>ASR_DIARIZE</code>.</strong>+ {% endif %}+ </p></div>+ {% endif %}</div></div>