08d1e3cee3
Removes user-facing engine/model/key/beam controls. The server now picks the best available engine automatically: 1. Microsoft Azure Speech — short clips (≤1MB, no diarization, audio/*) 2. Google Cloud Speech v2 — long audio, diarization, all languages 3. OpenAI Whisper GPU — local fallback Results display which provider was used (e.g. "Transcribed with Google Cloud Speech") via transcript-engine-badge and traceMeta. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
100 lines
7.7 KiB
PHP
100 lines
7.7 KiB
PHP
<?php
|
|
declare(strict_types=1);
|
|
$toolName = 'transcribe';
|
|
$toolTitle = 'Transcribe audio';
|
|
$toolKind = 'Audio Transcription';
|
|
$toolBadge = 'Azure · Google · Whisper';
|
|
require_once __DIR__ . '/includes/layout.php';
|
|
?>
|
|
<form id="toolForm" class="tool-form">
|
|
|
|
<div class="lang-switcher" id="uiLangSwitcher" role="group" aria-label="UI language">
|
|
<button type="button" class="lang-btn is-active" data-lang="en">🇬🇧 EN</button>
|
|
<button type="button" class="lang-btn" data-lang="no">🇳🇴 NO</button>
|
|
<button type="button" class="lang-btn" data-lang="uk">🇺🇦 UK</button>
|
|
<button type="button" class="lang-btn" data-lang="pl">🇵🇱 PL</button>
|
|
</div>
|
|
|
|
<div class="control-row" id="transcribeLangControl">
|
|
<span class="control-label" data-i18n="transcribeLang">Audio language</span>
|
|
<label><input type="radio" name="transcribeLang" value="no" checked> Norsk (nb)</label>
|
|
<label><input type="radio" name="transcribeLang" value="nn"> Nynorsk</label>
|
|
<label><input type="radio" name="transcribeLang" value="en"> English</label>
|
|
<label><input type="radio" name="transcribeLang" value="pl"> Polski</label>
|
|
<label><input type="radio" name="transcribeLang" value="uk"> Українська</label>
|
|
<label><input type="radio" name="transcribeLang" value="sv"> Svenska</label>
|
|
<label><input type="radio" name="transcribeLang" value="da"> Dansk</label>
|
|
<label><input type="radio" name="transcribeLang" value="de"> Deutsch</label>
|
|
<label><input type="radio" name="transcribeLang" value="fr"> Français</label>
|
|
<label><input type="radio" name="transcribeLang" value="auto"> Auto-detect <small class="control-hint" data-i18n="autoDetectHint">(may confuse nb/da/sv)</small></label>
|
|
</div>
|
|
|
|
<div class="control-row" id="diarizeControl">
|
|
<span class="control-label" data-i18n="speakers">Speakers</span>
|
|
<label><input type="checkbox" id="diarizeCheck" name="diarize"> <span data-i18n="identifySpeakers">Identify speakers</span></label>
|
|
<span class="control-label" style="margin-left:1.25rem" data-i18n="speakersCount">Count</span>
|
|
<input type="number" id="numSpeakersInput" name="num_speakers" min="2" max="20" placeholder="auto" class="num-speakers-input" data-i18n-placeholder="speakersPlaceholder" data-i18n-aria="speakersAriaLabel" aria-label="Expected number of speakers">
|
|
</div>
|
|
|
|
<div class="expert-field" id="vocabControl">
|
|
<div class="vocab-presets" id="vocabPresets">
|
|
<span class="control-label" data-i18n="vocabulary">Vocabulary</span>
|
|
<button type="button" class="vocab-btn" data-preset="barnerett" data-i18n="vocabPresetChildWelfare">Child welfare / CPS</button>
|
|
<button type="button" class="vocab-btn" data-preset="mediation" data-i18n="vocabPresetMediation">Mediation / legal meeting</button>
|
|
<button type="button" class="vocab-btn" data-preset="generell" data-i18n="vocabPresetGeneral">General Norwegian</button>
|
|
<button type="button" class="vocab-btn" data-preset="custom" data-i18n="vocabPresetCustom">Custom</button>
|
|
</div>
|
|
<textarea id="initPromptInput" name="initial_prompt" rows="2" placeholder="Technical terms and names for Whisper to recognise, e.g. Barnevernet, mediation, family services…" class="prompt-textarea" data-i18n-placeholder="vocabPlaceholder"></textarea>
|
|
<p class="upload-hint" data-i18n="vocabHint">Helps Whisper recognise technical terms. Not included in the transcript.</p>
|
|
</div>
|
|
|
|
<div class="upload-zone" id="audioZone" role="region" aria-label="Audio upload" data-i18n-aria="uploadAria">
|
|
<input type="file" id="audioInput" accept="audio/*,video/mp4,video/webm" multiple aria-label="Choose audio files">
|
|
<div id="audioPrompt" class="upload-prompt">
|
|
<span class="upload-icon" aria-hidden="true">▶</span>
|
|
<p><span data-i18n="uploadDrop">Drop audio file(s) here, or</span> <label for="audioInput" class="upload-browse" data-i18n="uploadBrowse">browse</label></p>
|
|
<p class="upload-hint"><strong>MP3</strong>, <strong>WAV</strong>, <strong>OGG</strong>, <strong>M4A</strong>, <strong>FLAC</strong>, <strong>WEBM</strong> — <span data-i18n="uploadHint">max 200 MB per file</span></p>
|
|
</div>
|
|
<div id="audioFileInfo" class="upload-file is-hidden">
|
|
<ol id="audioQueueList" class="audio-queue-list"></ol>
|
|
<div class="audio-queue-actions">
|
|
<label for="audioInput" class="upload-browse" data-i18n="uploadAddFiles">+ Add files</label>
|
|
<button type="button" id="audioClear" class="upload-clear" data-i18n="uploadClearQueue">× Clear queue</button>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
|
|
<!-- Hidden stubs so tools.js refs don't crash on this page -->
|
|
<div class="is-hidden" id="languageControl" aria-hidden="true">
|
|
<input type="radio" name="language" value="en" checked>
|
|
<input type="radio" name="language" value="no">
|
|
<input type="radio" name="language" value="uk">
|
|
<input type="radio" name="language" value="pl">
|
|
</div>
|
|
<div class="is-hidden" id="redactionControl" aria-hidden="true"></div>
|
|
<div class="is-hidden" id="uploadZone" aria-hidden="true">
|
|
<input type="file" id="uploadInput" style="display:none">
|
|
<div id="uploadPrompt"></div>
|
|
<div id="uploadFileInfo"><ul id="uploadFileList"></ul><button type="button" id="uploadClear"></button></div>
|
|
</div>
|
|
<div class="is-hidden" id="aliasSection" aria-hidden="true">
|
|
<button type="button" id="addAliasRow"></button>
|
|
<div id="aliasRows"></div>
|
|
</div>
|
|
<label class="is-hidden" id="inputLabel" for="toolInput"></label>
|
|
<textarea id="toolInput" name="toolInput" rows="1" class="is-hidden" aria-hidden="true"></textarea>
|
|
|
|
<div class="form-footer">
|
|
<p id="toolStatus" class="form-status" role="status" aria-live="polite"></p>
|
|
<button id="runButton" type="submit" data-i18n="run">Run</button>
|
|
</div>
|
|
</form>
|
|
|
|
<section id="results" class="results" aria-live="polite">
|
|
<div class="empty-state">
|
|
<h3 data-i18n="readyTitle">Ready</h3>
|
|
<p data-i18n="readyDesc">Select a tool, run a request, and the result appears here.</p>
|
|
</div>
|
|
</section>
|
|
<?php require_once __DIR__ . '/includes/layout_footer.php'; ?>
|