Spaces:
Sleeping
Sleeping
Upload 13 files
Browse files
app.py
CHANGED
|
@@ -164,10 +164,38 @@ Limits: {config.MAX_FILES} files, {config.MAX_MINUTES_PER_FILE} min per file, {c
|
|
| 164 |
"""
|
| 165 |
|
| 166 |
CSS = """
|
| 167 |
-
|
|
|
|
| 168 |
footer{display:none!important}
|
| 169 |
"""
|
| 170 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 171 |
|
| 172 |
with gr.Blocks(title="Audio Insight", delete_cache=(3600, 7200)) as demo:
|
| 173 |
gr.Markdown(INTRO)
|
|
@@ -200,5 +228,5 @@ with gr.Blocks(title="Audio Insight", delete_cache=(3600, 7200)) as demo:
|
|
| 200 |
|
| 201 |
if __name__ == "__main__":
|
| 202 |
demo.queue(default_concurrency_limit=2, max_size=20)
|
| 203 |
-
demo.launch(css=CSS, theme=
|
| 204 |
allowed_paths=[OUT_ROOT])
|
|
|
|
| 164 |
"""
|
| 165 |
|
| 166 |
CSS = """
|
| 167 |
+
html,body{background:#ffffff!important;color-scheme:light}
|
| 168 |
+
.report-frame{width:100%;height:900px;border:1px solid #dcdcdc;border-radius:6px;background:#ffffff}
|
| 169 |
footer{display:none!important}
|
| 170 |
"""
|
| 171 |
|
| 172 |
+
# Plain, professional look: white page, black text, grey lines, black primary button.
|
| 173 |
+
FONT = ["-apple-system", "BlinkMacSystemFont", "Segoe UI", "Helvetica Neue", "Arial", "sans-serif"]
|
| 174 |
+
THEME = gr.themes.Base(primary_hue=gr.themes.colors.neutral, secondary_hue=gr.themes.colors.neutral,
|
| 175 |
+
neutral_hue=gr.themes.colors.neutral, radius_size=gr.themes.sizes.radius_sm,
|
| 176 |
+
font=FONT).set(
|
| 177 |
+
body_background_fill="#ffffff", body_text_color="#111111", body_text_color_subdued="#555555",
|
| 178 |
+
background_fill_primary="#ffffff", background_fill_secondary="#fafafa",
|
| 179 |
+
block_background_fill="#ffffff", block_border_color="#dcdcdc", border_color_primary="#dcdcdc",
|
| 180 |
+
block_label_background_fill="#ffffff", block_label_text_color="#111111", block_title_text_color="#111111",
|
| 181 |
+
input_background_fill="#ffffff", link_text_color="#111111",
|
| 182 |
+
color_accent="#111111", color_accent_soft="#eeeeee", loader_color="#111111", slider_color="#111111",
|
| 183 |
+
checkbox_background_color_selected="#111111", checkbox_border_color_selected="#111111",
|
| 184 |
+
button_primary_background_fill="#111111", button_primary_background_fill_hover="#333333",
|
| 185 |
+
button_primary_text_color="#ffffff", button_primary_border_color="#111111",
|
| 186 |
+
)
|
| 187 |
+
|
| 188 |
+
# Always render in light mode (white background), even when the visitor's system is dark.
|
| 189 |
+
FORCE_LIGHT = """
|
| 190 |
+
() => {
|
| 191 |
+
const url = new URL(window.location.href);
|
| 192 |
+
if (url.searchParams.get('__theme') !== 'light') {
|
| 193 |
+
url.searchParams.set('__theme', 'light');
|
| 194 |
+
window.location.replace(url.href);
|
| 195 |
+
}
|
| 196 |
+
}
|
| 197 |
+
"""
|
| 198 |
+
|
| 199 |
|
| 200 |
with gr.Blocks(title="Audio Insight", delete_cache=(3600, 7200)) as demo:
|
| 201 |
gr.Markdown(INTRO)
|
|
|
|
| 228 |
|
| 229 |
if __name__ == "__main__":
|
| 230 |
demo.queue(default_concurrency_limit=2, max_size=20)
|
| 231 |
+
demo.launch(css=CSS, theme=THEME, js=FORCE_LIGHT, max_file_size=f"{config.MAX_UPLOAD_MB}mb",
|
| 232 |
allowed_paths=[OUT_ROOT])
|
charts.py
CHANGED
|
@@ -1,13 +1,11 @@
|
|
| 1 |
"""Charts for the HTML report.
|
| 2 |
|
| 3 |
-
SVG charts use CSS classes whose colours are defined in report.CSS
|
| 4 |
-
and dark mode each get their own validated steps. Every hoverable mark carries a
|
| 5 |
`data-tip` attribute that the report's small script shows as a tooltip; every
|
| 6 |
chart also gets a data table in the report, so no value is tooltip-only.
|
| 7 |
|
| 8 |
-
|
| 9 |
-
|
| 10 |
-
magnitude (heatmaps); blue/red diverging pair around a grey midpoint (sentiment).
|
| 11 |
"""
|
| 12 |
|
| 13 |
from __future__ import annotations
|
|
@@ -176,8 +174,7 @@ def hbars(items: list[tuple[str, float, str, int]], unit: str = "", domain: tupl
|
|
| 176 |
label_w: int = 150, diverging: bool = False, width: int = W, fmt=None) -> str:
|
| 177 |
"""Horizontal bars: items = [(label, value, tooltip, slot)]; slot 0 -> series 1.
|
| 178 |
|
| 179 |
-
Negative values extend left of a zero baseline
|
| 180 |
-
red negative)."""
|
| 181 |
items = [it for it in items if it[1] is not None and np.isfinite(it[1])]
|
| 182 |
if not items:
|
| 183 |
return ""
|
|
@@ -390,7 +387,7 @@ def trend_chart(label: str, unit: str, points: list[tuple[str, float, str]]) ->
|
|
| 390 |
# --- spectrogram (raster) ------------------------------------------------------------
|
| 391 |
|
| 392 |
def spectrogram_png(mel_db: np.ndarray, duration: float) -> str:
|
| 393 |
-
"""Base64 PNG of the mel spectrogram
|
| 394 |
if mel_db is None or mel_db.size == 0:
|
| 395 |
return ""
|
| 396 |
import matplotlib
|
|
@@ -401,8 +398,7 @@ def spectrogram_png(mel_db: np.ndarray, duration: float) -> str:
|
|
| 401 |
|
| 402 |
import librosa
|
| 403 |
|
| 404 |
-
cmap = LinearSegmentedColormap.from_list(
|
| 405 |
-
"blue_ramp", ["#fcfcfb", "#cde2fb", "#86b6ef", "#3987e5", "#1c5cab", "#0d366b"])
|
| 406 |
top = float(np.percentile(mel_db, 99.5))
|
| 407 |
fig = plt.figure(figsize=(7.2, 2.1), dpi=110)
|
| 408 |
ax = fig.add_axes([0.075, 0.2, 0.915, 0.75])
|
|
@@ -419,9 +415,9 @@ def spectrogram_png(mel_db: np.ndarray, duration: float) -> str:
|
|
| 419 |
ax.set_xticklabels([fmt_t(t) for t in xt])
|
| 420 |
for s in ax.spines.values():
|
| 421 |
s.set_visible(False)
|
| 422 |
-
ax.tick_params(colors="#
|
| 423 |
-
ax.set_ylabel("Hz", color="#
|
| 424 |
-
fig.patch.set_facecolor("#
|
| 425 |
buf = io.BytesIO()
|
| 426 |
fig.savefig(buf, format="png", facecolor=fig.get_facecolor())
|
| 427 |
plt.close(fig)
|
|
|
|
| 1 |
"""Charts for the HTML report.
|
| 2 |
|
| 3 |
+
SVG charts use CSS classes whose colours are defined in report.CSS. Every hoverable mark carries a
|
|
|
|
| 4 |
`data-tip` attribute that the report's small script shows as a tooltip; every
|
| 5 |
chart also gets a data table in the report, so no value is tooltip-only.
|
| 6 |
|
| 7 |
+
Monochrome by design: marks are near-black on white, magnitude uses a grey
|
| 8 |
+
ramp, and identity comes from labelled rows and lanes rather than colour.
|
|
|
|
| 9 |
"""
|
| 10 |
|
| 11 |
from __future__ import annotations
|
|
|
|
| 174 |
label_w: int = 150, diverging: bool = False, width: int = W, fmt=None) -> str:
|
| 175 |
"""Horizontal bars: items = [(label, value, tooltip, slot)]; slot 0 -> series 1.
|
| 176 |
|
| 177 |
+
Negative values extend left of a zero baseline, so direction shows the sign."""
|
|
|
|
| 178 |
items = [it for it in items if it[1] is not None and np.isfinite(it[1])]
|
| 179 |
if not items:
|
| 180 |
return ""
|
|
|
|
| 387 |
# --- spectrogram (raster) ------------------------------------------------------------
|
| 388 |
|
| 389 |
def spectrogram_png(mel_db: np.ndarray, duration: float) -> str:
|
| 390 |
+
"""Base64 PNG of the mel spectrogram (quiet = white, loud = black)."""
|
| 391 |
if mel_db is None or mel_db.size == 0:
|
| 392 |
return ""
|
| 393 |
import matplotlib
|
|
|
|
| 398 |
|
| 399 |
import librosa
|
| 400 |
|
| 401 |
+
cmap = LinearSegmentedColormap.from_list("grey_ramp", ["#ffffff", "#d9d9d9", "#969696", "#525252", "#111111"])
|
|
|
|
| 402 |
top = float(np.percentile(mel_db, 99.5))
|
| 403 |
fig = plt.figure(figsize=(7.2, 2.1), dpi=110)
|
| 404 |
ax = fig.add_axes([0.075, 0.2, 0.915, 0.75])
|
|
|
|
| 415 |
ax.set_xticklabels([fmt_t(t) for t in xt])
|
| 416 |
for s in ax.spines.values():
|
| 417 |
s.set_visible(False)
|
| 418 |
+
ax.tick_params(colors="#333333", labelsize=7.5, length=0)
|
| 419 |
+
ax.set_ylabel("Hz", color="#333333", fontsize=7.5)
|
| 420 |
+
fig.patch.set_facecolor("#ffffff")
|
| 421 |
buf = io.BytesIO()
|
| 422 |
fig.savefig(buf, format="png", facecolor=fig.get_facecolor())
|
| 423 |
plt.close(fig)
|
report.py
CHANGED
|
@@ -26,46 +26,33 @@ esc = charts.esc
|
|
| 26 |
|
| 27 |
CSS = """
|
| 28 |
:root{color-scheme:light;
|
| 29 |
-
--page:#
|
| 30 |
-
--border:
|
| 31 |
-
--
|
| 32 |
-
--
|
| 33 |
-
--hv-dark:#0b0b0b;--hv-light:#ffffff;--diag:#f0efec;
|
| 34 |
-
--good:#0ca30c;--warning:#fab219;--serious:#ec835a;--critical:#d03b3b}
|
| 35 |
-
@media (prefers-color-scheme:dark){:root:where(:not([data-theme="light"])){color-scheme:dark;
|
| 36 |
-
--page:#0d0d0d;--surface:#1a1a19;--card:#1a1a19;--ink:#ffffff;--ink2:#c3c2b7;--muted:#a3a198;--grid:#2c2c2a;--axis:#383835;
|
| 37 |
-
--border:rgba(255,255,255,.10);--accent:#3987e5;--wash:rgba(57,135,229,.14);
|
| 38 |
-
--s1:#3987e5;--s2:#d95926;--s3:#199e70;--s4:#c98500;--s5:#d55181;--s6:#008300;--s7:#9085e9;--s8:#e66767;
|
| 39 |
-
--q1:#0d366b;--q2:#184f95;--q3:#1c5cab;--q4:#256abf;--q5:#3987e5;--q6:#6da7ec;--q7:#9ec5f4;
|
| 40 |
-
--hv-dark:#ffffff;--hv-light:#0b0b0b;--diag:#383835}}
|
| 41 |
-
:root[data-theme="dark"]{color-scheme:dark;
|
| 42 |
-
--page:#0d0d0d;--surface:#1a1a19;--card:#1a1a19;--ink:#ffffff;--ink2:#c3c2b7;--muted:#a3a198;--grid:#2c2c2a;--axis:#383835;
|
| 43 |
-
--border:rgba(255,255,255,.10);--accent:#3987e5;--wash:rgba(57,135,229,.14);
|
| 44 |
-
--s1:#3987e5;--s2:#d95926;--s3:#199e70;--s4:#c98500;--s5:#d55181;--s6:#008300;--s7:#9085e9;--s8:#e66767;
|
| 45 |
-
--q1:#0d366b;--q2:#184f95;--q3:#1c5cab;--q4:#256abf;--q5:#3987e5;--q6:#6da7ec;--q7:#9ec5f4;
|
| 46 |
-
--hv-dark:#ffffff;--hv-light:#0b0b0b;--diag:#383835}
|
| 47 |
*{box-sizing:border-box}
|
| 48 |
-
body{margin:0;background:var(--page);color:var(--ink);font:15px/1.
|
| 49 |
.wrap{max-width:1040px;margin:0 auto;padding:28px 16px 64px}
|
| 50 |
h1{font-size:28px;line-height:1.2;margin:0 0 6px}
|
| 51 |
h2{font-size:21px;margin:40px 0 12px;padding-top:8px}
|
| 52 |
h3{font-size:17px;margin:26px 0 8px}
|
| 53 |
h4{font-size:15px;margin:18px 0 6px}
|
| 54 |
p{margin:6px 0 10px}
|
| 55 |
-
a{color:var(--accent)}
|
| 56 |
.sub{color:var(--ink2)}
|
| 57 |
.muted{color:var(--muted)}
|
| 58 |
-
.card{background:var(--card);border:1px solid var(--border);border-radius:
|
| 59 |
.tiles{display:grid;grid-template-columns:repeat(auto-fit,minmax(170px,1fr));gap:12px;margin:16px 0}
|
| 60 |
-
.tile{background:var(--card);border:1px solid var(--border);border-radius:
|
| 61 |
.tile .v{font-size:26px;font-weight:600;line-height:1.2}
|
| 62 |
.tile .l{color:var(--ink2);font-size:13px}
|
| 63 |
nav.toc{display:flex;flex-wrap:wrap;gap:6px 14px;font-size:14px;margin:10px 0 0}
|
| 64 |
-
.badge{display:inline-block;font-size:
|
| 65 |
-
.badge.ai{border-color:var(--
|
| 66 |
.status{display:inline-flex;align-items:center;gap:6px;font-size:13px;color:var(--ink)}
|
| 67 |
-
.status i{font-style:normal;display:inline-grid;place-items:center;width:18px;height:18px;border-radius:50%;
|
| 68 |
-
|
|
|
|
| 69 |
ul.flags{list-style:none;padding:0;margin:6px 0}ul.flags li{margin:4px 0;display:flex;gap:8px;align-items:flex-start}
|
| 70 |
blockquote{margin:8px 0;padding:6px 12px;border-left:3px solid var(--axis);color:var(--ink)}
|
| 71 |
blockquote .meta{display:block;color:var(--ink2);font-size:13px;margin-top:2px}
|
|
@@ -83,8 +70,8 @@ details{margin:8px 0}summary{cursor:pointer;color:var(--ink2);font-size:14px}
|
|
| 83 |
.chart .lab{fill:var(--ink2);font-size:11.5px}
|
| 84 |
.chart .val{fill:var(--ink);font-size:11.5px;font-variant-numeric:tabular-nums}
|
| 85 |
.chart .line{fill:none;stroke-width:2;stroke-linejoin:round;stroke-linecap:round}
|
| 86 |
-
.chart .area{opacity:.
|
| 87 |
-
.chart .pause{fill:
|
| 88 |
.chart .hit{fill:transparent}
|
| 89 |
.chart .hit:hover{fill:var(--wash)}
|
| 90 |
.chart .seg:hover,.chart .bar:hover,.chart .dot:hover,.chart [class^="q"]:hover{opacity:.8}
|
|
@@ -94,8 +81,8 @@ details{margin:8px 0}summary{cursor:pointer;color:var(--ink2);font-size:14px}
|
|
| 94 |
.chart .diag{fill:var(--diag)}
|
| 95 |
.chart .hv{font-size:11px;font-variant-numeric:tabular-nums}
|
| 96 |
.chart .hv1,.chart .hv2,.chart .hv3{fill:var(--hv-dark)}.chart .hv4,.chart .hv5,.chart .hv6,.chart .hv7{fill:var(--hv-light)}
|
| 97 |
-
.s1f
|
| 98 |
-
.s1s{stroke:var(--
|
| 99 |
.q1{fill:var(--q1)}.q2{fill:var(--q2)}.q3{fill:var(--q3)}.q4{fill:var(--q4)}.q5{fill:var(--q5)}.q6{fill:var(--q6)}.q7{fill:var(--q7)}
|
| 100 |
.o2{fill:var(--q3)}.o3{fill:var(--q5)}.o4{fill:var(--q7)}
|
| 101 |
.legend{display:flex;flex-wrap:wrap;gap:6px 16px;font-size:13px;color:var(--ink2);margin:4px 0}
|
|
@@ -109,13 +96,13 @@ details{margin:8px 0}summary{cursor:pointer;color:var(--ink2);font-size:14px}
|
|
| 109 |
.transcript p{margin:4px 0}.transcript .ts{color:var(--muted);font-variant-numeric:tabular-nums;margin-right:6px}
|
| 110 |
.transcript .sp{font-weight:600;margin-right:4px}
|
| 111 |
.search{width:100%;max-width:360px;padding:6px 10px;border:1px solid var(--border);border-radius:8px;background:var(--card);color:var(--ink);font:inherit;margin:6px 0}
|
| 112 |
-
.spec{width:100%;height:auto;border-radius:
|
| 113 |
#tip{position:fixed;z-index:10;pointer-events:none;max-width:340px;background:var(--card);color:var(--ink);border:1px solid var(--border);
|
| 114 |
-
border-radius:
|
| 115 |
#tip strong{display:block;font-size:13.5px}
|
| 116 |
.fid{display:inline-block;min-width:28px;font-weight:700}
|
| 117 |
.sr{position:absolute;width:1px;height:1px;overflow:hidden;clip:rect(0 0 0 0);white-space:nowrap}
|
| 118 |
-
.err{border-left:3px solid var(--
|
| 119 |
@media print{nav.toc,.search,#tip{display:none!important}.card{break-inside:avoid}body{background:#fff}}
|
| 120 |
@media (max-width:600px){.wrap{padding:18px 16px 48px}h1{font-size:23px}.card{padding:14px}}
|
| 121 |
"""
|
|
@@ -488,11 +475,7 @@ def _file_section(rec: dict, run: dict) -> str:
|
|
| 488 |
order = speaker_order(rec)
|
| 489 |
if lst and (lst.lines or lst.sound_events):
|
| 490 |
out.append(f"<h3>Who speaks when {ai_tag()}</h3>")
|
| 491 |
-
|
| 492 |
-
legend = [f'<span><b class="s{slots[sp]}f" style="background:var(--s{slots[sp]})"></b>{esc(sp)}</span>' for sp in order[:8]]
|
| 493 |
-
if lst.sound_events:
|
| 494 |
-
legend.append('<span><b class="dot" style="background:var(--ink2)"></b>non-speech sound</span>')
|
| 495 |
-
out.append('<div class="legend">' + "".join(legend) + "</div>")
|
| 496 |
out.append(charts.speaker_timeline(lst.lines, order, lst.sound_events, ac.duration_s))
|
| 497 |
png = charts.spectrogram_png(ac.mel_db, ac.duration_s)
|
| 498 |
if png:
|
|
|
|
| 26 |
|
| 27 |
CSS = """
|
| 28 |
:root{color-scheme:light;
|
| 29 |
+
--page:#ffffff;--surface:#ffffff;--card:#ffffff;--ink:#111111;--ink2:#333333;--muted:#666666;--grid:#e6e6e6;--axis:#bdbdbd;
|
| 30 |
+
--border:#dcdcdc;--accent:#111111;--wash:rgba(0,0,0,.05);--mark:#222222;
|
| 31 |
+
--q1:#f0f0f0;--q2:#d9d9d9;--q3:#bdbdbd;--q4:#969696;--q5:#737373;--q6:#4d4d4d;--q7:#252525;
|
| 32 |
+
--hv-dark:#111111;--hv-light:#ffffff;--diag:#f5f5f5}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 33 |
*{box-sizing:border-box}
|
| 34 |
+
body{margin:0;background:var(--page);color:var(--ink);font:15px/1.6 -apple-system,BlinkMacSystemFont,"Segoe UI","Helvetica Neue",Arial,sans-serif}
|
| 35 |
.wrap{max-width:1040px;margin:0 auto;padding:28px 16px 64px}
|
| 36 |
h1{font-size:28px;line-height:1.2;margin:0 0 6px}
|
| 37 |
h2{font-size:21px;margin:40px 0 12px;padding-top:8px}
|
| 38 |
h3{font-size:17px;margin:26px 0 8px}
|
| 39 |
h4{font-size:15px;margin:18px 0 6px}
|
| 40 |
p{margin:6px 0 10px}
|
| 41 |
+
a{color:var(--accent);text-decoration:underline;text-underline-offset:2px}
|
| 42 |
.sub{color:var(--ink2)}
|
| 43 |
.muted{color:var(--muted)}
|
| 44 |
+
.card{background:var(--card);border:1px solid var(--border);border-radius:6px;padding:18px 20px;margin:14px 0}
|
| 45 |
.tiles{display:grid;grid-template-columns:repeat(auto-fit,minmax(170px,1fr));gap:12px;margin:16px 0}
|
| 46 |
+
.tile{background:var(--card);border:1px solid var(--border);border-radius:6px;padding:14px 16px}
|
| 47 |
.tile .v{font-size:26px;font-weight:600;line-height:1.2}
|
| 48 |
.tile .l{color:var(--ink2);font-size:13px}
|
| 49 |
nav.toc{display:flex;flex-wrap:wrap;gap:6px 14px;font-size:14px;margin:10px 0 0}
|
| 50 |
+
.badge{display:inline-block;font-size:11.5px;line-height:1.4;padding:1px 7px;border-radius:3px;border:1px solid var(--border);color:var(--ink2);background:var(--surface);white-space:nowrap;font-weight:500}
|
| 51 |
+
.badge.ai{border-color:var(--ink);color:var(--ink)}
|
| 52 |
.status{display:inline-flex;align-items:center;gap:6px;font-size:13px;color:var(--ink)}
|
| 53 |
+
.status i{font-style:normal;display:inline-grid;place-items:center;width:18px;height:18px;border-radius:50%;font-size:11px;font-weight:700;
|
| 54 |
+
border:1.5px solid var(--ink);color:var(--ink);background:var(--card)}
|
| 55 |
+
.status.serious i,.status.critical i{background:var(--ink);color:#ffffff}
|
| 56 |
ul.flags{list-style:none;padding:0;margin:6px 0}ul.flags li{margin:4px 0;display:flex;gap:8px;align-items:flex-start}
|
| 57 |
blockquote{margin:8px 0;padding:6px 12px;border-left:3px solid var(--axis);color:var(--ink)}
|
| 58 |
blockquote .meta{display:block;color:var(--ink2);font-size:13px;margin-top:2px}
|
|
|
|
| 70 |
.chart .lab{fill:var(--ink2);font-size:11.5px}
|
| 71 |
.chart .val{fill:var(--ink);font-size:11.5px;font-variant-numeric:tabular-nums}
|
| 72 |
.chart .line{fill:none;stroke-width:2;stroke-linejoin:round;stroke-linecap:round}
|
| 73 |
+
.chart .area{opacity:.06}
|
| 74 |
+
.chart .pause{fill:#f0f0f0}
|
| 75 |
.chart .hit{fill:transparent}
|
| 76 |
.chart .hit:hover{fill:var(--wash)}
|
| 77 |
.chart .seg:hover,.chart .bar:hover,.chart .dot:hover,.chart [class^="q"]:hover{opacity:.8}
|
|
|
|
| 81 |
.chart .diag{fill:var(--diag)}
|
| 82 |
.chart .hv{font-size:11px;font-variant-numeric:tabular-nums}
|
| 83 |
.chart .hv1,.chart .hv2,.chart .hv3{fill:var(--hv-dark)}.chart .hv4,.chart .hv5,.chart .hv6,.chart .hv7{fill:var(--hv-light)}
|
| 84 |
+
.s1f,.s2f,.s3f,.s4f,.s5f,.s6f,.s7f,.s8f{fill:var(--mark)}
|
| 85 |
+
.s1s{stroke:var(--mark)}
|
| 86 |
.q1{fill:var(--q1)}.q2{fill:var(--q2)}.q3{fill:var(--q3)}.q4{fill:var(--q4)}.q5{fill:var(--q5)}.q6{fill:var(--q6)}.q7{fill:var(--q7)}
|
| 87 |
.o2{fill:var(--q3)}.o3{fill:var(--q5)}.o4{fill:var(--q7)}
|
| 88 |
.legend{display:flex;flex-wrap:wrap;gap:6px 16px;font-size:13px;color:var(--ink2);margin:4px 0}
|
|
|
|
| 96 |
.transcript p{margin:4px 0}.transcript .ts{color:var(--muted);font-variant-numeric:tabular-nums;margin-right:6px}
|
| 97 |
.transcript .sp{font-weight:600;margin-right:4px}
|
| 98 |
.search{width:100%;max-width:360px;padding:6px 10px;border:1px solid var(--border);border-radius:8px;background:var(--card);color:var(--ink);font:inherit;margin:6px 0}
|
| 99 |
+
.spec{width:100%;height:auto;border-radius:4px;border:1px solid var(--border)}
|
| 100 |
#tip{position:fixed;z-index:10;pointer-events:none;max-width:340px;background:var(--card);color:var(--ink);border:1px solid var(--border);
|
| 101 |
+
border-radius:4px;padding:8px 10px;font-size:12.5px;line-height:1.4;box-shadow:0 2px 10px rgba(0,0,0,.12);display:none}
|
| 102 |
#tip strong{display:block;font-size:13.5px}
|
| 103 |
.fid{display:inline-block;min-width:28px;font-weight:700}
|
| 104 |
.sr{position:absolute;width:1px;height:1px;overflow:hidden;clip:rect(0 0 0 0);white-space:nowrap}
|
| 105 |
+
.err{border-left:3px solid var(--ink);padding-left:10px}
|
| 106 |
@media print{nav.toc,.search,#tip{display:none!important}.card{break-inside:avoid}body{background:#fff}}
|
| 107 |
@media (max-width:600px){.wrap{padding:18px 16px 48px}h1{font-size:23px}.card{padding:14px}}
|
| 108 |
"""
|
|
|
|
| 475 |
order = speaker_order(rec)
|
| 476 |
if lst and (lst.lines or lst.sound_events):
|
| 477 |
out.append(f"<h3>Who speaks when {ai_tag()}</h3>")
|
| 478 |
+
out.append('<p class="sub small">One row per speaker; dots in the last row mark non-speech sounds. Hover for the words.</p>')
|
|
|
|
|
|
|
|
|
|
|
|
|
| 479 |
out.append(charts.speaker_timeline(lst.lines, order, lst.sound_events, ac.duration_s))
|
| 480 |
png = charts.spectrogram_png(ac.mel_db, ac.duration_s)
|
| 481 |
if png:
|