Skip to content

知了 Cicada · 任何会议和直播的实时字幕、同声传译、AI 会议纪要,Mac、Windows、Linux、Android 免费开源。Live subtitles, interpreting and meeting notes for any call or stream, on Mac, Windows, Linux and Android.

feat(linux): open to the records window with a checklist of what's left to set up, and a test sound for the computer's audio

wqugurue5c14eb731df
diff --git a/linux/cicada/app/debug.py b/linux/cicada/app/debug.py
index 76564ae..7a62799 100644
--- a/linux/cicada/app/debug.py
+++ b/linux/cicada/app/debug.py
@@ -259,7 +259,7 @@ def command(app, line: str) -> dict:
if cmd == "onboarding-step":
app.show_onboarding()
app.onboarding.go(int(arg))
- return {"ok": True, "step": app.onboarding.step}
+ return {"ok": True, "step": app.onboarding.step if app.onboarding is not None else "done"}
if cmd == "quit":
app.quit()
return {"ok": True}
diff --git a/linux/cicada/app/main.py b/linux/cicada/app/main.py
index 3991dc1..be19ff7 100644
--- a/linux/cicada/app/main.py
+++ b/linux/cicada/app/main.py
@@ -121,7 +121,7 @@ class Controller:
self.tray.tick()
return True
- def launch(self, speak: bool = False) -> None:
+ def launch(self, speak: bool = False, background: bool = False) -> None:
ui.install_css()
lang = strings.language
ui.DEFAULT_LANG = ui.pango_lang({"zh-Hans": "zh-CN"}.get(lang, lang)) if lang != "en" else ui.pango_lang(self.settings.notes_code)
@@ -146,14 +146,17 @@ class Controller:
GLib.unix_signal_add(GLib.PRIORITY_DEFAULT, sig, self._signalled, sig)
if Paths.dev:
debug.start(self)
+ from .settings_window import refresh_autostart
+ refresh_autostart(self.launcher)
+ if self.settings.onboarded and self.ling.has_key:
+ threading.Thread(target=self.ling.check, daemon=True).start()
+ # Opened by hand, 知了 shows its window: a top-bar icon alone looks like nothing happened, and
+ # plain GNOME has no top bar icon at all. Only a login start (--background) with an icon to be
+ # reached through, set up already, stays out of the way. Not set up: the onboarding on top.
+ if not background or self.tray is None or not self.settings.onboarded:
+ self.show_records()
if not self.settings.onboarded:
- self.show_onboarding()
- else:
- if self.ling.has_key:
- threading.Thread(target=self.ling.check, daemon=True).start()
- # Without a tray (plain GNOME has none) the records window is how the app is reached.
- if self.tray is None:
- self.show_records()
+ GLib.timeout_add(500, lambda: self.show_onboarding() and False)
reopened = self.updates.reopened()
if reopened and self.settings.onboarded:
self.show_records() # where 已更新到 … is said, once
@@ -209,22 +212,66 @@ class Controller:
self.settings_window.show_all()
self.settings_window.present()
- def show_onboarding(self) -> None:
+ # Setup (会议记录 › 还差几步 and the capsule)
+
+ @property
+ def setup_done(self) -> tuple:
+ """The setup steps as the onboarding numbers them (key, computer sound, sample): done by what
+ really happened, not by "the onboarding was finished" (Windows' SetupDone)."""
+ s = self.settings
+ return self.ling.has_key, s.heardSystemAudio or s.onboarded, s.sampleSeen or s.onboarded
+
+ @property
+ def setup_left(self) -> int:
+ """Steps left before listening works; 0 once set up. 同声传译 is optional and never counted."""
+ key, audio, sample = self.setup_done
+ if self.settings.onboarded and key:
+ return 0
+ return (not key) + (not audio) + (not sample)
+
+ def setup_step_done(self, name: str) -> None:
+ """The onboarding heard the computer (heardSystemAudio) or played the sample (sampleSeen)."""
+ if not getattr(self.settings, name):
+ setattr(self.settings, name, True)
+ self.settings.save()
+ self.changed()
+
+ def show_onboarding(self, step: int | None = None) -> None:
+ """The onboarding at `step`, or at the first step not done, over the records window."""
+ from .onboarding import AUDIO, KEY, SAMPLE, Onboarding
+ key, audio, _ = self.setup_done
+ at = step if step is not None else KEY if not key else AUDIO if not audio else SAMPLE
if self.onboarding is not None:
+ if step is not None and self.onboarding.step != step:
+ self.onboarding.go(step)
self.onboarding.present()
return
- from .onboarding import Onboarding
- self.onboarding = Onboarding(self)
+ self.onboarding = Onboarding(self, at)
self.application.add_window(self.onboarding)
+ # Over the records window, so closing it leaves a window to click, not an empty screen.
+ if self.records_window is not None and self.records_window.get_visible():
+ self.onboarding.set_transient_for(self.records_window)
+ self.onboarding.set_position(Gtk.WindowPosition.CENTER_ON_PARENT)
def closed(*_):
self.onboarding = None
- if self.tray is None and self.settings.onboarded:
+ if self.tray is None and (self.records_window is None or not self.records_window.get_visible()):
self.show_records()
+ self.changed()
self.onboarding.connect("destroy", closed)
self.onboarding.show_all()
self.onboarding.present()
+ def records_closed(self) -> None:
+ """The records window was closed: once, say 知了 is still in the top bar (it keeps running)."""
+ if self.tray is None or self.settings.trayHintShown:
+ return
+ self.settings.trayHintShown = True
+ self.settings.save()
+ n = Gio.Notification.new(L("知了还在顶栏"))
+ n.set_body(L("从右上角的知了图标打开会议记录,或开始听。"))
+ self.application.send_notification("still-here", n)
+
def set_view(self, view: str) -> None:
if view not in ("notes", "subtitles") or view == self.settings.view:
return
@@ -600,14 +647,17 @@ class App(Gtk.Application):
a.connect("activate", lambda _a, _p, f=action: f())
self.add_action(a)
self.set_accels_for_action("app." + name, keys)
- self.controller.launch(speak=getattr(self, "speak_at_start", False))
+ self.controller.launch(speak=getattr(self, "speak_at_start", False), background=getattr(self, "background", False))
if getattr(self, "toggle_at_start", False):
GLib.idle_add(lambda: self.controller.toggle_listening() and False)
def do_activate(self):
- # A second launch lands here in the running instance: open the records.
- if self.controller is not None and self.controller.settings.onboarded and getattr(self, "_activated", False):
+ # A second launch lands here in the running instance: the records, and the onboarding on top
+ # while not set up (closed with ✕ earlier, it would otherwise never come back).
+ if self.controller is not None and getattr(self, "_activated", False):
self.controller.show_records()
+ if not self.controller.settings.onboarded:
+ self.controller.show_onboarding()
self._activated = True
@@ -618,6 +668,9 @@ def main(argv=None) -> int:
argv.remove("--dev")
GLib.set_prgname("cicada")
app = App()
+ if "--background" in argv: # 登录时启动: stay in the top bar
+ argv.remove("--background")
+ app.background = True
for flag, action in (("--toggle", "toggle"), ("--speak", "speak")):
if flag in argv:
argv.remove(flag)
diff --git a/linux/cicada/app/onboarding.py b/linux/cicada/app/onboarding.py
index 6b32134..841f5b9 100644
--- a/linux/cicada/app/onboarding.py
+++ b/linux/cicada/app/onboarding.py
@@ -5,15 +5,18 @@ works without the Ling key, and 接 Ling comes first (the Mac puts it third). So
(no permission on Linux) → sample meeting → 同声传译, if wanted → where Cicada lives."""
from __future__ import annotations
+import os
+import shutil
+import subprocess
import threading
from collections import deque
-from gi.repository import Gdk, GLib, Gtk
+from gi.repository import Gdk, GLib, Gtk, Pango
from ..core import ling as lingmod
-from ..core.audio import Wav
+from ..core.audio import Wav, sink_description
from ..core.strings import L, LF
-from ..core.support import TARGETS
+from ..core.support import TARGETS, Log
from . import ui
from .capture import SystemAudio
from .settings_window import LING_PLATFORM, SHORTCUTS, choice, gnome_shortcut, open_uri, set_gnome_shortcut, target_options
@@ -23,7 +26,7 @@ STEPS = 4
class Onboarding(Gtk.Window):
- def __init__(self, app):
+ def __init__(self, app, step: int | None = None):
super().__init__(title=L("知了"))
self.app = app
# Fixed at the Mac's 860 x 640. Not set_resizable(False): GTK then sizes the window to its
@@ -40,6 +43,9 @@ class Onboarding(Gtk.Window):
self.set_titlebar(bar)
outer = Gtk.Box(orientation=Gtk.Orientation.VERTICAL)
ui.pad(outer, 6, 64, 36, 64)
+ # The page's real width as its minimum: GTK 3 sizes a window for its content at the content's
+ # minimum width, where every wrapped line wraps most, so the fixed 640 would be outgrown.
+ outer.set_size_request(860 - 128, -1)
self.head = Gtk.Box(orientation=Gtk.Orientation.HORIZONTAL, spacing=14)
outer.pack_start(self.head, False, False, 0)
self.page = Gtk.Box(orientation=Gtk.Orientation.VERTICAL)
@@ -55,7 +61,10 @@ class Onboarding(Gtk.Window):
self.speak_setup = None # 同声传译: None until chosen here (then True / False)
self.connect("destroy", lambda *_: self._stop_tap())
self.connect("key-press-event", self._key)
- self.step = AUDIO if app.ling.has_key else KEY
+ self.step = step if step is not None and (step == KEY or app.ling.has_key) else AUDIO if app.ling.has_key else KEY
+ self.testing = None # 放一段测试声音: the player while it plays
+ self.tested = False # a test sound played and nothing was heard
+ self.device = None # the default output's name, once pactl has said it
self.render()
def _key(self, _w, event) -> bool:
@@ -285,7 +294,9 @@ class Onboarding(Gtk.Window):
# 2. System audio
def _audio_step(self) -> None:
- self._title(L("让知了听到电脑里的声音"), L("知了听的是电脑播放出来的声音,不用麦克风,也不用授权。"))
+ self._title(L("让知了听到电脑里的声音"), L("会议里对方说的话从电脑放出来,字幕和纪要都从这里来。不用麦克风,也不用授权。"))
+ if self.device is None:
+ threading.Thread(target=self._find_device, daemon=True).start()
if self.tap is None:
self.tap = SystemAudio()
@@ -307,9 +318,31 @@ class Onboarding(Gtk.Window):
self.bars.append(b)
self.heard_row = ui.hbox(6)
trailing = ui.hbox(12, meter, self.heard_row)
- self._card(self._row("audio-speakers-symbolic", L("听电脑里的声音"), L("只听声音,不录屏幕画面"), trailing))
+ source = self._row("audio-speakers-symbolic", L("电脑播放的声音"), self._device_line(), trailing)
+ self.device_label = source.get_children()[1].get_children()[1] # the row's detail line
+ test = ui.button(L("正在播放…") if self.testing else L("放一段测试声音"), self._play_test, "accentbtn midbtn",
+ "media-playback-start-symbolic")
+ test.set_sensitive(self.testing is None)
+ self.test_button = test
+ test_row = Gtk.Box(orientation=Gtk.Orientation.HORIZONTAL, spacing=16)
+ test_row.pack_start(ui.vbox(2, ui.text(L("没有声音在放?"), 14, "ink", wrap=False),
+ ui.text(L("放 3 秒测试声音,从同一个设备出来"), 13, "secondary", wrap=False)), True, True, 0)
+ test.set_valign(Gtk.Align.CENTER)
+ test_row.pack_end(test, False, False, 0)
+ self._card(source, ui.pad(test_row, 16, 22))
+ # The two sounds side by side: people try speaking first, but this step hears the computer.
+ sources = Gtk.Box(orientation=Gtk.Orientation.HORIZONTAL, spacing=12, homogeneous=True)
+ sources.pack_start(self._source(L("对方的声音"), L("这一步"), [L("会议软件"), L("扬声器"), L("知了:字幕和纪要")], True), True, True, 0)
+ sources.pack_start(self._source(L("你的声音 · 麦克风"), L("第 4 步再用"), [L("麦克风"), L("同声传译"), L("对方听到译文")], False), True, True, 0)
+ self.page.pack_start(ui.gap(sources, 12), False, False, 0)
+ self.sources = sources
+ sources.set_no_show_all(True) # _fill_silent decides, not the window's show_all
+ # Played and still nothing: most likely the sound goes to another output (an HDMI screen).
+ self.silent = Gtk.Box()
+ self.page.pack_start(ui.gap(self.silent, 12), False, False, 0)
+ self._fill_silent()
self._back()
- self.audio_hint = ui.text(L("音量条没动?放段视频或音乐试试"), 13, "secondary", wrap=False)
+ self.audio_hint = Gtk.Box() # 放一段测试声音 says what the old 音量条没动? hint said
self.footer.pack_start(self.audio_hint, True, True, 0)
self.audio_next = Gtk.Box()
self.footer.pack_end(self.audio_next, False, False, 0)
@@ -326,8 +359,122 @@ class Onboarding(Gtk.Window):
self._update_heard()
return True
+ def _source(self, title: str, badge: str, flow: list, on: bool) -> Gtk.Widget:
+ """One of the two sounds and where it goes, outlined in ink when it is this step's."""
+ head = ui.hbox(8, ui.text(title, 14, "ink", bold=True, wrap=False),
+ ui.panel(ui.text(badge, 11, "", bold=on, wrap=False, ellipsize=False), "badge" if on else "srcbadge"))
+ # One wrapping label, each step on a tinted ground (the last in ink when it is this step's):
+ # GTK 3 sizes a FlowBox for its narrowest layout, which would stretch the fixed-size window.
+ words = []
+ for i, word in enumerate(flow):
+ last = on and i == len(flow) - 1
+ words.append('<span background="%s" foreground="%s">\u00a0%s\u00a0</span>'
+ % ("#15171C" if last else "#F3F4F6", "#FFFFFF" if last else "#15171C",
+ GLib.markup_escape_text(word).replace(" ", "\u00a0"))) # breaks only between steps
+ path = ui.text("", 12, "", width_chars=36)
+ path.set_markup('<span size="%d">%s</span>' % (round(12 * 768), ' <span foreground="#5A5F6B">→</span> '.join(words)))
+ # Whole words only: WORD_CHAR's one-character minimum width makes GTK 3 ask for a window as
+ # tall as the text would be one letter wide.
+ path.set_line_wrap_mode(Pango.WrapMode.WORD)
+ return ui.panel(ui.pad(ui.vbox(8, head, path), 12, 16, 10, 16), "srccard", "on" if on else "")
+
+ def _device_line(self) -> str:
+ return LF("%@ · 只听声音,不录屏幕画面", self.device) if self.device else L("只听声音,不录屏幕画面")
+
+ def _find_device(self) -> None:
+ """The default output's name ("内置音频 模拟立体声") through pactl, off the main loop; none
+ without pactl (the row then says only what it hears)."""
+ name = None
+ if shutil.which("pactl"):
+ env = dict(os.environ, LC_ALL="C")
+ try:
+ sink = subprocess.run(["pactl", "get-default-sink"], capture_output=True, text=True, timeout=3, env=env).stdout.strip()
+ # Descriptions in the desktop's language: pactl translates them under LANG.
+ sinks = subprocess.run(["pactl", "list", "sinks"], capture_output=True, text=True, timeout=3,
+ env=dict(os.environ, LC_MESSAGES="C")).stdout
+ name = sink_description(sinks, sink)
+ except (OSError, subprocess.SubprocessError):
+ pass
+
+ def show():
+ self.device = name or ""
+ if self.step == AUDIO and hasattr(self, "device_label"):
+ ui.retext(self.device_label, self._device_line())
+ return False
+ GLib.idle_add(show)
+
+ def _play_test(self) -> None:
+ """放一段测试声音: the sample's first 3 s through the default output, the device Cicada hears:
+ the bars move only if the sound really reaches the monitor."""
+ from .main import sample_path
+ path = sample_path()
+ player = next((p for p in ("pw-play", "paplay", "aplay") if shutil.which(p)), None)
+ if self.testing is not None or path is None or player is None:
+ return
+ try:
+ self.testing = subprocess.Popen([player, path], stdout=subprocess.DEVNULL, stderr=subprocess.DEVNULL)
+ except OSError as e:
+ Log.d("onboarding: test sound failed %s" % type(e).__name__)
+ return
+ Log.d("onboarding: test sound (%s)" % player)
+ self.tested = False
+ self._fill_silent()
+ self.test_button.get_child().get_children()[-1].set_text(L("正在播放…"))
+ self.test_button.set_sensitive(False)
+ GLib.timeout_add(3000, self._test_ended)
+
+ def _test_ended(self) -> bool:
+ self._stop_test()
+ if self.step != AUDIO:
+ return False
+
+ def settle(): # the last buffers arrive a moment after the player stops
+ if self.step != AUDIO:
+ return False
+ self.tested = self.peak < 0.01
+ Log.d("onboarding: test sound %s" % ("not heard" if self.tested else "heard"))
+ self.test_button.get_child().get_children()[-1].set_text(L("放一段测试声音"))
+ self.test_button.set_sensitive(True)
+ self._fill_silent()
+ return False
+ GLib.timeout_add(400, settle)
+ return False
+
+ def _fill_silent(self) -> None:
+ """The warning takes the two sounds' place, so the window keeps its fixed size."""
+ ui.clear(self.silent)
+ if self.tested:
+ self.sources.hide()
+ else:
+ for child in self.sources.get_children(): # show_all() skips a no_show_all widget
+ child.show_all()
+ self.sources.show()
+ if not self.tested:
+ self.silent.hide()
+ return
+ row = Gtk.Box(orientation=Gtk.Orientation.HORIZONTAL, spacing=12)
+ row.pack_start(ui.icon("dialog-warning-symbolic", 16), False, False, 0)
+ row.get_children()[0].set_valign(Gtk.Align.START)
+ ui.classes(row.get_children()[0], "link")
+ row.pack_start(ui.vbox(2, ui.text(L("测试声音放了,但知了没听到"), 14, "ink", bold=True, wrap=False),
+ ui.text(L("看看声音是不是从别的设备出来(比如 HDMI 显示器),或被静音了。"), 13, "ink", width_chars=50)),
+ True, True, 0)
+ # GNOME's own sound page; other desktops differ, so only there.
+ if "GNOME" in os.environ.get("XDG_CURRENT_DESKTOP", "").upper() and shutil.which("gnome-control-center"):
+ b = ui.button(L("打开声音设置"), lambda: subprocess.Popen(["gnome-control-center", "sound"]), "outline")
+ b.set_valign(Gtk.Align.CENTER)
+ row.pack_end(b, False, False, 0)
+ strip = ui.panel(ui.pad(row, 12, 16), "endingstrip")
+ self.silent.pack_start(strip, True, True, 0)
+ self.silent.show_all()
+
def _update_heard(self) -> None:
heard = self.peak >= 0.01
+ if heard:
+ self.app.setup_step_done("heardSystemAudio")
+ if self.tested:
+ self.tested = False
+ self._fill_silent()
if self._heard_shown == heard:
return
self._heard_shown = heard
@@ -418,6 +565,8 @@ class Onboarding(Gtk.Window):
def _play(self) -> None:
self.app.play_sample()
+ if self.app.listen.listening:
+ self.app.setup_step_done("sampleSeen")
self._fill_sample()
# 4. 同声传译
@@ -553,7 +702,14 @@ class Onboarding(Gtk.Window):
below.pack_end(arrow, False, False, 0)
return ui.panel(ui.vbox(0, top, below), "bigcard", "clip")
+ def _stop_test(self) -> None:
+ if self.testing is not None:
+ player, self.testing = self.testing, None
+ player.terminate()
+ threading.Thread(target=player.wait, daemon=True).start() # reaped, not left a zombie
+
def _stop_tap(self) -> None:
+ self._stop_test()
if self.meter is not None:
GLib.source_remove(self.meter)
self.meter = None
diff --git a/linux/cicada/app/records_window.py b/linux/cicada/app/records_window.py
index a033184..737094d 100644
--- a/linux/cicada/app/records_window.py
+++ b/linux/cicada/app/records_window.py
@@ -30,7 +30,7 @@ class RecordsWindow(Gtk.Window):
self.set_size_request(720, 480)
self.set_position(Gtk.WindowPosition.CENTER)
self.set_wmclass("cicada", "Cicada")
- self.connect("delete-event", lambda *_: self.hide() or True)
+ self.connect("delete-event", lambda *_: self.hide() or self.app.records_closed() or True)
self.selected = None
self.pending_delete = None # a record deleted but still undoable
self.query = ""
@@ -56,6 +56,7 @@ class RecordsWindow(Gtk.Window):
self.bar_side = ui.panel(ui.pad(ui.text(L("会议记录"), 13, "heading", bold=True, wrap=False), 0, 0, 0, 18), "sidebar-top")
self.bar_side.set_size_request(260, -1)
self.bar_side.get_child().set_valign(Gtk.Align.CENTER)
+ self.bar_side.set_no_show_all(True) # with the sidebar: hidden while there are no meetings
bar.pack_start(self.bar_side)
bar.pack_end(self._app_menu())
self.set_titlebar(bar)
@@ -152,8 +153,9 @@ class RecordsWindow(Gtk.Window):
if listen.listening:
state = "ending" if app.ending is not None else "live"
else:
- state = "auto" if app.auto_ended else "idle"
- key = (state, app.ending.reason.kind + app.ending.reason.name if state == "ending" else "")
+ state = "auto" if app.auto_ended else "setup" if app.setup_left else "idle"
+ key = (state, app.ending.reason.kind + app.ending.reason.name if state == "ending" else
+ str(app.setup_left) if state == "setup" else "")
if key != getattr(self, "_pill_state", None):
first = getattr(self, "_pill_state", None) is None
self._pill_state = key
@@ -162,7 +164,22 @@ class RecordsWindow(Gtk.Window):
box = Gtk.Box(orientation=Gtk.Orientation.HORIZONTAL)
box.set_valign(Gtk.Align.CENTER)
box.set_halign(Gtk.Align.CENTER)
- if state in ("idle", "auto"):
+ if state == "setup":
+ # Not set up yet: the capsule says how much is left and opens the onboarding there.
+ b = Gtk.Button()
+ inner = ui.hbox(9, self._logo(22), ui.text(L("知了"), 13, "ink", bold=True, wrap=False, ellipsize=False),
+ ui.panel(Gtk.Box(), "pillsep"),
+ ui.text(LF("还差 %@ 步", app.setup_left), 13, "link", bold=True, wrap=False, ellipsize=False),
+ ui.text(L("继续设置"), 11, "secondary", wrap=False, ellipsize=False))
+ sep = inner.get_children()[2]
+ sep.set_size_request(1, 14)
+ sep.set_valign(Gtk.Align.CENTER)
+ b.add(inner)
+ ui.classes(b, "listenpill")
+ b.connect("clicked", lambda *_: self.app.show_onboarding())
+ b.get_accessible().set_name(L("继续设置"))
+ box.pack_start(b, False, False, 0)
+ elif state in ("idle", "auto"):
b = Gtk.Button()
inner = ui.hbox(9, self._logo(22), ui.text(L("知了"), 13, "ink", bold=True, wrap=False, ellipsize=False),
ui.panel(Gtk.Box(), "pillsep"),
@@ -366,6 +383,8 @@ class RecordsWindow(Gtk.Window):
self.list.add(row)
self.list.show_all()
self.sidebar.set_visible(bool(everything))
+ self.bar_side.set_visible(bool(everything))
+ self.bar_side.get_child().show_all()
if not sessions:
self.selected = None if not everything else self.selected
elif self.selected not in [s.id for s in sessions]:
@@ -397,6 +416,112 @@ class RecordsWindow(Gtk.Window):
self.columns.set_orientation(want)
self.columns.set_homogeneous(want == Gtk.Orientation.HORIZONTAL)
+ def _setup_page(self) -> Gtk.Widget:
+ """No meetings and not set up yet (Windows' Welcome › Checklist): what is left, ticked by what
+ really happened, each step opening the onboarding where it is. 同声传译 is optional."""
+ app = self.app
+ key, audio, sample = app.setup_done
+ first = 0 if not key else 1 if not audio else 2 if not sample else 3
+ page = Gtk.Box(orientation=Gtk.Orientation.VERTICAL)
+ page.set_halign(Gtk.Align.CENTER)
+ page.set_valign(Gtk.Align.CENTER)
+ page.set_vexpand(True)
+ mark = self._logo(72)
+ mark.set_halign(Gtk.Align.CENTER)
+ page.pack_start(mark, False, False, 0)
+ t = ui.text(LF("还差 %@ 步就能用", app.setup_left), 26, "heading", bold=True, wrap=False)
+ t.set_halign(Gtk.Align.CENTER)
+ page.pack_start(ui.gap(t, 26), False, False, 0)
+ line = ui.text(L("知了把电脑里放出来的会议声音变成字幕和纪要。"), 15, "secondary", wrap=False)
+ line.set_halign(Gtk.Align.CENTER)
+ page.pack_start(ui.gap(line, 8), False, False, 0)
+ from .settings_window import SHORTCUTS, gnome_shortcut
+ speak = (LF("按 %@ 说话,对方听到翻译后的声音", SHORTCUTS["speak"][2].replace(" + Shift + ", " ⇧ "))
+ if gnome_shortcut("speak") else L("点纪要窗的麦克风说话,对方听到翻译后的声音"))
+ steps = ((L("接上 Ling"), L("只存在这台电脑上(只有你的账户能读)") if key else L("识别、翻译和纪要都靠它,约 1 分钟"), key),
+ (L("听一下电脑里的声音"), L("放一段测试声音,看音量条动起来"), audio),
+ (L("看看效果"), L("一段 9 秒的英文会议,字幕和纪要一句句出来"), sample),
+ (L("同声传译"), L("以后在设置 › 同声传译里打开") if app.settings.speakLater and not app.settings.speakEnabled
+ else speak, app.settings.speakEnabled))
+ rows = Gtk.Box(orientation=Gtk.Orientation.VERTICAL)
+ for i, (title, detail, done) in enumerate(steps):
+ if i:
+ sep = ui.panel(Gtk.Box(), "hair")
+ sep.set_size_request(-1, 1)
+ rows.pack_start(sep, False, False, 0)
+ now = i == first
+ disc = ui.panel(ui.icon("object-select-symbolic", 13) if done else
+ ui.text(str(i + 1), 12, "", bold=True, wrap=False, ellipsize=False),
+ "setupdisc", "done" if done else "now" if now else "")
+ disc.set_size_request(26, 26)
+ disc.get_child().set_halign(Gtk.Align.CENTER)
+ disc.get_child().set_valign(Gtk.Align.CENTER)
+ disc.set_valign(Gtk.Align.CENTER)
+ head = ui.hbox(8, ui.text(title, 14, "secondary" if done else "ink", bold=not done, wrap=False))
+ head.set_halign(Gtk.Align.START)
+ if i == 3:
+ head.pack_start(ui.panel(ui.text(L("可选"), 11, "secondary", wrap=False, ellipsize=False), "setuptag"), False, False, 0)
+ sub = ui.text(detail, 12, "secondary", width_chars=40)
+ sub.set_halign(Gtk.Align.START)
+ sub.set_xalign(0)
+ texts = ui.vbox(1, head, sub)
+ texts.set_valign(Gtk.Align.CENTER)
+ row = ui.hbox(14, disc)
+ row.pack_start(texts, True, True, 0) # filled, so the words start at the left of every row
+ action = None
+ if now:
+ action = ui.button(L("继续设置"), lambda n=i: app.show_onboarding(n), "darkbtn")
+ elif i == 3 and not done and not app.settings.speakLater:
+ action = ui.button(L("以后再说"), self._speak_later, "outline")
+ if action is not None:
+ action.set_valign(Gtk.Align.CENTER)
+ row.pack_end(action, False, False, 0)
+ rows.pack_start(ui.pad(row, 14, 0), False, False, 0)
+ card = ui.panel(ui.pad(rows, 2, 18), "setupcard")
+ card.set_size_request(460, -1)
+ page.pack_start(ui.gap(card, 28), False, False, 0)
+ page.set_margin_bottom(40)
+ return page
+
+ def _speak_later(self) -> None:
+ self.app.settings.speakLater = True
+ self.app.settings.save()
+ self.app.changed()
+
+ def _welcome_page(self) -> Gtk.Widget:
+ """No meetings yet, set up (Views.swift › welcome): the logo, one line, 开始听 and the sample."""
+ page = Gtk.Box(orientation=Gtk.Orientation.VERTICAL)
+ page.set_halign(Gtk.Align.CENTER)
+ page.set_valign(Gtk.Align.CENTER)
+ page.set_vexpand(True)
+ mark = self._logo(72)
+ mark.set_halign(Gtk.Align.CENTER)
+ page.pack_start(mark, False, False, 0)
+ t = ui.text(L("还没有会议"), 26, "heading", bold=True, wrap=False)
+ t.set_halign(Gtk.Align.CENTER)
+ page.pack_start(ui.gap(t, 26), False, False, 0)
+ line = ui.text(L("打开会议或视频,开始听后,每一场都会存在这里。"), 15, "secondary", wrap=False)
+ line.set_halign(Gtk.Align.CENTER)
+ page.pack_start(ui.gap(line, 8), False, False, 0)
+ inner = ui.hbox(10, ui.dot(True), ui.text(L("开始听"), 15, "", bold=True, wrap=False, ellipsize=False))
+ keys = self._shortcut_hint()
+ if keys:
+ cap = ui.panel(ui.pad(ui.text(keys, 12, "", wrap=False, ellipsize=False), 0, 6, 1, 6), "ctakeys")
+ cap.set_valign(Gtk.Align.CENTER)
+ inner.pack_start(cap, False, False, 0)
+ start = Gtk.Button()
+ start.add(inner)
+ ui.classes(start, "ctapill")
+ start.connect("clicked", lambda *_: self.app.toggle_listening())
+ start.get_accessible().set_name(L("开始听"))
+ start.set_halign(Gtk.Align.CENTER)
+ page.pack_start(ui.gap(start, 30), False, False, 0)
+ sample = ui.button(L("先听一段示例"), self.app.play_sample, "quietbtn greytext")
+ sample.set_halign(Gtk.Align.CENTER)
+ page.pack_start(ui.gap(sample, 10), False, False, 0)
+ page.set_margin_bottom(40)
+ return page
+
def _status_page(self, icon_name, title, body, actions) -> Gtk.Widget:
page = Gtk.Box(orientation=Gtk.Orientation.VERTICAL, spacing=0)
page.set_halign(Gtk.Align.CENTER)
@@ -429,11 +554,16 @@ class RecordsWindow(Gtk.Window):
ui.clear(d)
self.columns = None
self._built_key = None
+ if empty and self.app.setup_left:
+ d.pack_start(self._setup_page(), True, True, 0)
+ d.show_all()
+ return
if empty:
- d.pack_start(self._status_page("audio-speakers-symbolic", L("还没有会议记录"),
- L("点“开始听”,将电脑播放的声音转为双语字幕和纪要"),
- [ui.button(L("开始听"), self.app.toggle_listening, "accentbtn pill"),
- ui.button(L("播放示例会议"), self.app.play_sample, "outline pill")]), True, True, 0)
+ d.pack_start(self._welcome_page(), True, True, 0)
+ if self.app.tray is not None: # where 知了 is once this window is closed
+ hint = ui.text(L("关掉窗口后,知了在顶栏右上角"), 12, "secondary", wrap=False)
+ hint.set_halign(Gtk.Align.END)
+ d.pack_end(ui.pad(hint, 0, 18, 14, 0), False, False, 0)
d.show_all()
return
if no_match:
diff --git a/linux/cicada/app/settings_window.py b/linux/cicada/app/settings_window.py
index 47a48b2..8090512 100644
--- a/linux/cicada/app/settings_window.py
+++ b/linux/cicada/app/settings_window.py
@@ -66,12 +66,25 @@ def set_autostart(on: bool, launcher: str) -> None:
pass
return
os.makedirs(os.path.dirname(path), exist_ok=True)
+ # --background: a login start stays in the top bar; opening 知了 by hand shows its window.
with open(path, "w", encoding="utf-8") as f:
f.write("[Desktop Entry]\nType=Application\nName=Cicada\nName[zh_CN]=知了\n"
- "Exec=%s%s\nIcon=cicada\nTerminal=false\nNoDisplay=true\nX-GNOME-Autostart-enabled=true\n"
+ "Exec=%s%s --background\nIcon=cicada\nTerminal=false\nNoDisplay=true\nX-GNOME-Autostart-enabled=true\n"
% (launcher, " --dev" if Paths.dev else ""))
+def refresh_autostart(launcher: str) -> None:
+ """An autostart file from before --background (or from another install place) is rewritten."""
+ path = autostart_path()
+ try:
+ with open(path, encoding="utf-8") as f:
+ text = f.read()
+ except OSError:
+ return
+ if "--background" not in text or ("Exec=%s " % launcher) not in text:
+ set_autostart(True, launcher)
+
+
# GNOME custom keyboard shortcuts: `cicada --toggle` (开始 / 结束听) and `cicada --speak` (开始 / 停止说).
PREVIEW = { # what 试听 says, spoken text not UI (not L()): one per language a voice speaks
diff --git a/linux/cicada/app/ui.py b/linux/cicada/app/ui.py
index d6ad60e..243b79d 100644
--- a/linux/cicada/app/ui.py
+++ b/linux/cicada/app/ui.py
@@ -254,6 +254,29 @@ entry.keyentry { border-radius: 10px; min-height: 34px; }
.midcard { background-color: #FFFFFF; border: 1px solid #E4E6EA; border-radius: 12px; }
.tipcard { background-color: #FFFFFF; border-radius: 14px; }
.hair { background-color: #E4E6EA; min-height: 1px; }
+.srccard { background-color: #FFFFFF; border: 1px solid #E4E6EA; border-radius: 14px; }
+.srccard.on { border: 2px solid #15171C; }
+.srcbadge { background-color: #F3F4F6; border-radius: 5px; padding: 0 6px; }
+.srcbadge label { color: #5A5F6B; }
+.srcstep { background-color: #F3F4F6; border-radius: 6px; padding: 1px 7px 2px 7px; }
+.srcstep label { color: #15171C; }
+.srcstep.on { background-color: #15171C; }
+.srcstep.on label { color: #FFFFFF; }
+.srccard flowbox, .srccard flowboxchild { padding: 0; background: none; }
+button.quietbtn.greytext label { color: #5A5F6B; }
+button.ctapill { background-image: none; background-color: #15171C; border: none; box-shadow: none; border-radius: 22px; min-height: 44px; padding: 0 22px; }
+button.ctapill:hover { background-color: #2A2D34; }
+button.ctapill label { color: #FFFFFF; }
+.ctakeys { border: 1px solid rgba(255,255,255,0.35); border-radius: 5px; }
+.ctakeys label { color: #BDC0C7; }
+.setupcard { background-color: #F7F8FA; border-radius: 16px; }
+.setupdisc { background-color: #FFFFFF; border: 1px solid #E4E6EA; border-radius: 13px; }
+.setupdisc label { color: #3A3E48; }
+.setupdisc.done { background-color: #15171C; border-color: #15171C; }
+.setupdisc.done image { color: #FFFFFF; }
+.setupdisc.now { background-color: #E8552B; border-color: #E8552B; }
+.setupdisc.now label { color: #FFFFFF; }
+.setuptag { background-color: #FFFFFF; border: 1px solid #E4E6EA; border-radius: 9px; padding: 0 7px; }
.stepnum { background-color: #15171C; border-radius: 12px; min-width: 24px; min-height: 24px; }
.stepnum label { color: #FFFFFF; }
button.bigbtn { background-image: none; background-color: #15171C; color: #FFFFFF; border: none; box-shadow: none; border-radius: 12px; min-height: 44px; padding: 0 28px; font-size: 14px; font-weight: 700; }
diff --git a/linux/cicada/core/audio.py b/linux/cicada/core/audio.py
index 56467e2..e14f143 100644
--- a/linux/cicada/core/audio.py
+++ b/linux/cicada/core/audio.py
@@ -140,3 +140,18 @@ class Wav:
if not len(buf):
return 0.0
return math.sqrt(sum(x * x for x in buf) / len(buf)) / 32768
+
+
+def sink_description(pactl_sinks: str, name: str) -> str | None:
+ """The description of sink `name` in `pactl list sinks` output (the onboarding shows the default
+ output by it). The field names are English under LC_MESSAGES=C; the description stays translated."""
+ if not name:
+ return None
+ current = None
+ for line in pactl_sinks.splitlines():
+ field, _, value = line.strip().partition(":")
+ if field == "Name":
+ current = value.strip()
+ elif field == "Description" and current == name:
+ return value.strip() or None
+ return None
diff --git a/linux/cicada/core/settings.py b/linux/cicada/core/settings.py
index e87014c..1fa5a32 100644
--- a/linux/cicada/core/settings.py
+++ b/linux/cicada/core/settings.py
@@ -17,6 +17,11 @@ class AppSettings:
"view": "notes", # "notes" (the notes window, default) or "subtitles" (the subtitle bar)
"showInCapture": False, # 共享屏幕时让对方看到 (Linux can't hide it; see NotesWindow)
"onboarded": False,
+ # The setup checklist (会议记录 › 还差几步): the onboarding heard the computer's sound / played the sample.
+ "heardSystemAudio": False,
+ "sampleSeen": False,
+ "speakLater": False, # 还差几步 › 同声传译 › 以后再说
+ "trayHintShown": False, # 知了还在顶栏, said once after the records window is first closed
"uiLanguage": "system", # "system", "zh-Hans", "en", "ja" or "ko"
# 同声传译: what I say is interpreted and spoken into 知了 麦克风 (the Mac's speakEnabled etc.).
"speakerVoices": True, # 说话人识别: tell the other side's voices apart (说话人 1、2…), as on the Mac
diff --git a/linux/strings/en.lproj/Linux.strings b/linux/strings/en.lproj/Linux.strings
index 6142695..d384a6f 100644
--- a/linux/strings/en.lproj/Linux.strings
+++ b/linux/strings/en.lproj/Linux.strings
@@ -147,3 +147,39 @@
"没能更新到 %@,还是原来的版本" = "Couldn’t update to %@; still on the previous version";
"会后安装" = "Install after the meeting";
"会议结束后安装" = "installs when the meeting ends";
+
+/* First run: 还差几步, the test sound, the two sounds */
+"知了还在顶栏" = "Cicada is still in the top bar";
+"从右上角的知了图标打开会议记录,或开始听。" = "Open records or start listening from the icon at the top right.";
+"会议里对方说的话从电脑放出来,字幕和纪要都从这里来。不用麦克风,也不用授权。" = "What others say in a meeting plays from the computer; the subtitles and notes come from there. No microphone and no permission needed.";
+"电脑播放的声音" = "What your computer plays";
+"放一段测试声音" = "Play a test sound";
+"没有声音在放?" = "Nothing playing?";
+"放 3 秒测试声音,从同一个设备出来" = "Plays 3 seconds of test sound on the same device";
+"对方的声音" = "Their voices";
+"这一步" = "This step";
+"会议软件" = "Meeting app";
+"扬声器" = "Speakers";
+"知了:字幕和纪要" = "Cicada: subtitles and notes";
+"你的声音 · 麦克风" = "Your voice · microphone";
+"第 4 步再用" = "Used in step 4";
+"对方听到译文" = "They hear the translation";
+"%@ · 只听声音,不录屏幕画面" = "%@ · Sound only, never the screen";
+"测试声音放了,但知了没听到" = "The test sound played, but Cicada didn't hear it";
+"看看声音是不是从别的设备出来(比如 HDMI 显示器),或被静音了。" = "Check whether the sound is going to another device (an HDMI monitor, say) or is muted.";
+"打开声音设置" = "Open Sound Settings";
+"还差 %@ 步" = "%@ to go";
+"继续设置" = "Continue setup";
+"还差 %@ 步就能用" = "Almost ready: %@ to go";
+"知了把电脑里放出来的会议声音变成字幕和纪要。" = "Cicada turns the meeting audio your computer plays into subtitles and notes.";
+"按 %@ 说话,对方听到翻译后的声音" = "Press %@ to speak; the room hears you translated";
+"点纪要窗的麦克风说话,对方听到翻译后的声音" = "Click the mic in the notes window to speak; the room hears you translated";
+"只存在这台电脑上(只有你的账户能读)" = "Kept only on this computer (only your account can read it)";
+"识别、翻译和纪要都靠它,约 1 分钟" = "Transcription, translation and notes need it. About a minute.";
+"听一下电脑里的声音" = "Check your computer's sound";
+"放一段测试声音,看音量条动起来" = "Play a test sound and watch the meter move";
+"看看效果" = "See it work";
+"一段 9 秒的英文会议,字幕和纪要一句句出来" = "A 9-second English meeting, with subtitles and notes as they come";
+"可选" = "Optional";
+"以后再说" = "Not now";
+"关掉窗口后,知了在顶栏右上角" = "After you close this, Cicada stays in the top bar";
diff --git a/linux/strings/ja.lproj/Linux.strings b/linux/strings/ja.lproj/Linux.strings
index b406635..ff74980 100644
--- a/linux/strings/ja.lproj/Linux.strings
+++ b/linux/strings/ja.lproj/Linux.strings
@@ -147,3 +147,39 @@
"没能更新到 %@,还是原来的版本" = "%@ にアップデートできませんでした。以前のバージョンのままです";
"会后安装" = "会議後にインストール";
"会议结束后安装" = "会議が終わったらインストール";
+
+/* First run: 还差几步, the test sound, the two sounds */
+"知了还在顶栏" = "Cicada はトップバーにあります";
+"从右上角的知了图标打开会议记录,或开始听。" = "右上の Cicada アイコンから会議の記録を開くか、聞き取りを始められます。";
+"会议里对方说的话从电脑放出来,字幕和纪要都从这里来。不用麦克风,也不用授权。" = "会議の相手の声はコンピュータから流れ、字幕とメモはそこから作られます。マイクも許可も要りません。";
+"电脑播放的声音" = "PC から流れる音";
+"放一段测试声音" = "テスト音を流す";
+"没有声音在放?" = "何も再生していませんか?";
+"放 3 秒测试声音,从同一个设备出来" = "同じデバイスから 3 秒のテスト音を鳴らします";
+"对方的声音" = "相手の声";
+"这一步" = "このステップ";
+"会议软件" = "会議アプリ";
+"扬声器" = "スピーカー";
+"知了:字幕和纪要" = "Cicada:字幕とメモ";
+"你的声音 · 麦克风" = "あなたの声 · マイク";
+"第 4 步再用" = "ステップ 4 で使います";
+"对方听到译文" = "相手に翻訳が届く";
+"%@ · 只听声音,不录屏幕画面" = "%@ · 音声のみ、画面は録画しません";
+"测试声音放了,但知了没听到" = "テスト音は鳴りましたが、Cicada には聞こえませんでした";
+"看看声音是不是从别的设备出来(比如 HDMI 显示器),或被静音了。" = "音が別のデバイス(HDMI モニターなど)から出ていないか、ミュートされていないか確認してください。";
+"打开声音设置" = "サウンド設定を開く";
+"还差 %@ 步" = "あと %@ ステップ";
+"继续设置" = "設定を続ける";
+"还差 %@ 步就能用" = "あと %@ ステップで使えます";
+"知了把电脑里放出来的会议声音变成字幕和纪要。" = "Cicada は PC から流れる会議の音声を字幕とメモにします。";
+"按 %@ 说话,对方听到翻译后的声音" = "%@ を押して話すと、相手には翻訳された音声が届きます";
+"点纪要窗的麦克风说话,对方听到翻译后的声音" = "メモウインドウのマイクを押して話すと、相手には翻訳された音声が届きます";
+"只存在这台电脑上(只有你的账户能读)" = "このコンピュータにだけ保存(あなたのアカウントだけが読めます)";
+"识别、翻译和纪要都靠它,约 1 分钟" = "文字起こし・翻訳・メモに使います。約 1 分";
+"听一下电脑里的声音" = "PC の音を確認";
+"放一段测试声音,看音量条动起来" = "テスト音を流してメーターが動くか確認";
+"看看效果" = "試してみる";
+"一段 9 秒的英文会议,字幕和纪要一句句出来" = "9 秒の英語の会議で、字幕とメモが出てくる様子を確認";
+"可选" = "任意";
+"以后再说" = "あとで";
+"关掉窗口后,知了在顶栏右上角" = "閉じても Cicada は右上のトップバーにあります";
diff --git a/linux/strings/ko.lproj/Linux.strings b/linux/strings/ko.lproj/Linux.strings
index 9a5cc3e..b0ec2de 100644
--- a/linux/strings/ko.lproj/Linux.strings
+++ b/linux/strings/ko.lproj/Linux.strings
@@ -146,3 +146,39 @@
"没能更新到 %@,还是原来的版本" = "%@(으)로 업데이트하지 못했습니다. 이전 버전 그대로입니다";
"会后安装" = "회의 후 설치";
"会议结束后安装" = "회의가 끝나면 설치";
+
+/* First run: 还差几步, the test sound, the two sounds */
+"知了还在顶栏" = "Cicada는 상단 바에 있어요";
+"从右上角的知了图标打开会议记录,或开始听。" = "오른쪽 위 Cicada 아이콘에서 회의 기록을 열거나 듣기를 시작하세요.";
+"会议里对方说的话从电脑放出来,字幕和纪要都从这里来。不用麦克风,也不用授权。" = "회의에서 상대방의 말은 컴퓨터에서 재생되고, 자막과 노트는 여기서 만들어져요. 마이크도 권한도 필요 없어요.";
+"电脑播放的声音" = "PC에서 나오는 소리";
+"放一段测试声音" = "테스트 소리 틀기";
+"没有声音在放?" = "재생 중인 소리가 없나요?";
+"放 3 秒测试声音,从同一个设备出来" = "같은 장치로 3초 테스트 사운드를 재생해요";
+"对方的声音" = "상대방 목소리";
+"这一步" = "이 단계";
+"会议软件" = "회의 앱";
+"扬声器" = "스피커";
+"知了:字幕和纪要" = "Cicada: 자막과 회의록";
+"你的声音 · 麦克风" = "내 목소리 · 마이크";
+"第 4 步再用" = "4단계에서 사용";
+"对方听到译文" = "상대가 번역을 들어요";
+"%@ · 只听声音,不录屏幕画面" = "%@ · 소리만 듣고 화면은 녹화하지 않아요";
+"测试声音放了,但知了没听到" = "테스트 사운드가 재생됐지만 Cicada가 듣지 못했어요";
+"看看声音是不是从别的设备出来(比如 HDMI 显示器),或被静音了。" = "소리가 다른 장치(예: HDMI 모니터)로 나가거나 음소거되지 않았는지 확인하세요.";
+"打开声音设置" = "사운드 설정 열기";
+"还差 %@ 步" = "%@단계 남음";
+"继续设置" = "설정 계속하기";
+"还差 %@ 步就能用" = "%@단계만 더 하면 돼요";
+"知了把电脑里放出来的会议声音变成字幕和纪要。" = "Cicada는 PC에서 나오는 회의 소리를 자막과 회의록으로 바꿔요.";
+"按 %@ 说话,对方听到翻译后的声音" = "%@ 키를 눌러 말하면 상대방은 번역된 음성을 들어요";
+"点纪要窗的麦克风说话,对方听到翻译后的声音" = "노트 창의 마이크를 눌러 말하면 상대방은 번역된 음성을 들어요";
+"只存在这台电脑上(只有你的账户能读)" = "이 컴퓨터에만 저장돼요(내 계정만 읽을 수 있어요)";
+"识别、翻译和纪要都靠它,约 1 分钟" = "인식, 번역, 회의록에 필요해요. 약 1분";
+"听一下电脑里的声音" = "PC 소리 확인하기";
+"放一段测试声音,看音量条动起来" = "테스트 소리를 틀고 미터가 움직이는지 확인";
+"看看效果" = "직접 보기";
+"一段 9 秒的英文会议,字幕和纪要一句句出来" = "9초짜리 영어 회의로 자막과 회의록이 나오는 모습을 확인";
+"可选" = "선택";
+"以后再说" = "나중에";
+"关掉窗口后,知了在顶栏右上角" = "창을 닫아도 Cicada는 오른쪽 위 상단 바에 있어요";
diff --git a/linux/tests/test_core.py b/linux/tests/test_core.py
index b2235f2..19eb84c 100644
--- a/linux/tests/test_core.py
+++ b/linux/tests/test_core.py
@@ -368,6 +368,27 @@ class Hearing(Base):
self.assertEqual("a b", join("a ", " b", "en"))
+class FirstRun(Base):
+ def test_setup_facts_are_kept(self):
+ s = AppSettings()
+ self.assertEqual((False, False, False), (s.heardSystemAudio, s.sampleSeen, s.trayHintShown))
+ s.heardSystemAudio = s.sampleSeen = True
+ s.save()
+ back = AppSettings.load()
+ self.assertEqual((True, True, False), (back.heardSystemAudio, back.sampleSeen, back.trayHintShown))
+
+ def test_default_output_is_named_by_its_description(self):
+ from cicada.core.audio import sink_description
+ sinks = ("Sink #48\n\tState: SUSPENDED\n\tName: alsa_output.hdmi-stereo\n\tDescription: HDMI / DisplayPort\n"
+ "\tDriver: PipeWire\n\nSink #51\n\tState: RUNNING\n\tName: alsa_output.pci-0000_00_1f.3.analog-stereo\n"
+ "\tDescription: 内置音频 模拟立体声\n\tMonitor Source: alsa_output.pci-0000_00_1f.3.analog-stereo.monitor\n")
+ self.assertEqual("内置音频 模拟立体声", sink_description(sinks, "alsa_output.pci-0000_00_1f.3.analog-stereo"))
+ self.assertEqual("HDMI / DisplayPort", sink_description(sinks, "alsa_output.hdmi-stereo"))
+ self.assertIsNone(sink_description(sinks, "missing"))
+ self.assertIsNone(sink_description(sinks, ""))
+ self.assertIsNone(sink_description("", "alsa_output.hdmi-stereo"))
+
+
class Segmenting(Base):
def test_segments_on_pauses(self):
got = cut(silence(0.5), tone(2.0), silence(1.0), tone(1.5), silence(1.0))
diff --git a/site/changelog.json b/site/changelog.json
index 71d520d..4a1bcf0 100644
--- a/site/changelog.json
+++ b/site/changelog.json
@@ -16,6 +16,16 @@
"title": "Linux 版有新版本时会提示,点一下就更新并重新打开。",
"text": "顶栏菜单第一项和设置 › 关于都会显示;下载后先核对校验值再安装,正在听时等会议结束再装。"
},
+ {
+ "kind": "fixed",
+ "title": "Linux 上打开知了总会出现会议记录窗口,没设置完时引导叠在上面。",
+ "text": "以前设置好之后再打开,只多一个顶栏图标;中途关掉引导,再打开也不会回来。登录时自动启动的仍只待在顶栏。"
+ },
+ {
+ "kind": "new",
+ "title": "Linux 的会议记录窗口会列出还差哪几步,“听声音”这一步能直接放一段测试声音。",
+ "text": "清单按实际情况打勾,点哪步就从哪步继续;测试声音放了却没听到,会提示检查输出设备。"
+ },
{
"kind": "fixed",
"title": "录“我自己的声音”时读得太慢会提醒重录,克隆的声音不再拖得很慢。",