The App Lives in the Tray
The exported file never shows the process around it. Roughcast had a recorder, an editor and a composition timeline, but it still behaved like a command in a terminal: no voice for the script, no presence on the desktop, and no way to stop a monitor recording without walking back into the frame. The last pass was about those boundaries.
A Voice for Invisible Text
A text annotation can be marked as voiceover. It is not a second track or a separate audio project: it is the same text
element with visible: false. The renderer skips it on the canvas and in the export, while the element list and the
timeline keep it as the script that belongs to a moment.
The first version gave every annotation the same fixed duration. TTS does not work that way. Roughcast now synthesizes the line locally, measures the WAV, and lets the annotation end follow the natural audio length. The preview plays the cached voice in sync with the playhead, including a seek into the middle of a line. No cloud API is involved; the text never leaves the machine.
Export posts a voiceover manifest to the local server, which synthesizes or reuses the cached WAVs, mixes them at their timestamps and muxes the result. MP4 gets AAC, WebM gets Opus, and trim, speed, freeze and cut outs apply to the voice track as well as the video. The browser renders the frames; ffmpeg finishes the sound.
The Engine Has to Say Why
The TTS layer wraps espeak-ng, espeak, Piper and the macOS say command. Piper is the quality option, but it needs
a voice model next to the binary. When one of those pieces was missing, the old detection returned nil and the UI said
only “not available”. That is a dead end, not a diagnosis.
The server now reports the resolved engine, binary, model and a concrete ttsError. Settings shows the same reason, and
the start log names the binary and model. Piper is preferred when --tts-model is set, so an installed eSpeak cannot
silently shadow it. The maintained Piper lives in OHF-Voice/piper1-gpl; because it bundles its eSpeak data,
--tts-data stays an eSpeak-only flag.
An Icon Instead of a Terminal
The desktop shell is a tray icon. It uses gogpu/systray, which is pure Go and keeps CGO off on Linux, macOS and
Windows. The menu offers Open Roughcast, Stop recording and Quit Roughcast. A click opens the UI; the stop
item broadcasts the same SSE command as roughcast ctl stop.
The tray also owns the lifecycle. Quit and a signal share one graceful shutdown path before the icon is removed. A
normal start shows the tray and opens the browser; --no-open shows the tray without the browser, and --headless runs
only the server for CI, WSL or a desktop without a tray host. The icon is a 32×32 render of the pictogram already used
by the PWA.
On Linux the icon is a StatusNotifierItem. A desktop without a tray host shows nothing, which is a boundary of the platform rather than a hidden fallback.
Two Small Truths on the Canvas
The strip under the video existed only for compositions. A single take now gets the same strip, with its title, length and playhead. Clicking a position maps the source time through speed, freeze and cut outs and seeks there; on a composition the clicked clip is selected as well.
The other correction was smaller. An invisible voiceover has nothing to outline, so it no longer draws a dashed selection frame and handle around empty space. It stays selectable from the Elements list and editable in the inspector, where the voice settings live anyway.
A local recorder is not finished when the file plays. It is finished when the script can speak without a cloud, the missing engine explains itself, and the process can be stopped from the corner of the screen. The tray does not make Roughcast a native app; it stops the terminal from being the only way to live with it.
