diff --git a/.gitea/workflows/ci.yml b/.gitea/workflows/ci.yml index e08cbcf..2713610 100644 --- a/.gitea/workflows/ci.yml +++ b/.gitea/workflows/ci.yml @@ -112,3 +112,11 @@ jobs: - name: Core identity smoke under qemu-aarch64 (emulated, not native hardware) run: node scripts/core-smoke.mjs core/target/aarch64-unknown-linux-gnu/release/teamspeach-core --wrapper "qemu-aarch64 -L /usr/aarch64-linux-gnu" + + # The unit tests (voice detector, resampler, identity keys, codecs, protocol) built for aarch64 and run + # under user-mode qemu. Emulated, not native hardware; the bridge smoke tests spawn the core binary and + # are left to the host build above. + - name: Core unit tests under qemu-aarch64 (emulated, not native hardware) + env: + CARGO_TARGET_AARCH64_UNKNOWN_LINUX_GNU_RUNNER: qemu-aarch64 -L /usr/aarch64-linux-gnu + run: cargo test --manifest-path core/Cargo.toml --locked --target aarch64-unknown-linux-gnu --bin teamspeach-core diff --git a/.gitea/workflows/update-e2e.yml b/.gitea/workflows/update-e2e.yml index 4486a5a..597e3f5 100644 --- a/.gitea/workflows/update-e2e.yml +++ b/.gitea/workflows/update-e2e.yml @@ -13,6 +13,10 @@ on: to_tag: description: Newer release tag the old one must update to (e.g. v0.1.2-rc.2) required: true + new_prefs: + description: Optional JSON of settings that exist only in the new version, applied after the update and checked after a restart + required: false + default: '' permissions: contents: read @@ -55,10 +59,16 @@ jobs: env: FROM_TAG: ${{ inputs.from_tag }} TO_TAG: ${{ inputs.to_tag }} + NEW_PREFS: ${{ inputs.new_prefs }} run: | set -euo pipefail [[ "$TO_TAG" =~ ^v[0-9]+\.[0-9]+\.[0-9]+(-[0-9A-Za-z.-]+)?$ ]] || { echo "bad tag $TO_TAG"; exit 2; } - xvfb-run -a node scripts/update-e2e.mjs --from "old/TeamsPeach-${FROM_TAG#v}.AppImage" --to-tag "$TO_TAG" --out update-e2e-out + if [ -n "$NEW_PREFS" ]; then + node -e 'const p = JSON.parse(process.argv[1]); if (!p || typeof p !== "object" || Array.isArray(p)) process.exit(2)' "$NEW_PREFS" + xvfb-run -a node scripts/update-e2e.mjs --from "old/TeamsPeach-${FROM_TAG#v}.AppImage" --to-tag "$TO_TAG" --out update-e2e-out --new-prefs "$NEW_PREFS" + else + xvfb-run -a node scripts/update-e2e.mjs --from "old/TeamsPeach-${FROM_TAG#v}.AppImage" --to-tag "$TO_TAG" --out update-e2e-out + fi cat update-e2e-out/result.json - uses: actions/upload-artifact@v3 diff --git a/CHANGELOG.md b/CHANGELOG.md index c8d9e07..a4ef05a 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,24 @@ # Changelog +## 0.1.3 — unreleased + +- Added voice activation as a third transmission mode next to push to talk and the open microphone + (Settings → Audio → Voice transmission, sensitivity High / Normal / Low). The core decides locally with + the earshot voice detector (a small embedded neural network, no cloud service, no speech recognition) on + audio that has already passed the microphone processing (noise suppression, echo cancellation, gain + control). It sends from about 100 ms before a detected onset until about 400 ms after the last detected + speech; right after connecting, unmuting or changing the mode every frame since then is kept, so the first + word is sent in full (about 200 ms later). Muting, deafening, disconnecting, a channel or codec change and + a server talk denial discard what the detector heard. Push to talk and the open microphone are unchanged; + stored settings keep their mode, and new profiles still start with push to talk. +- The transmission mode moved from Settings → Keyboard to Settings → Audio; the push-to-talk key stays in + Keyboard. The microphone test explains that it only shows the input level and never transmits. +- The renderer forwards microphone audio only after the core has confirmed the selected mode; a failed + mode change is shown and nothing is sent until it is applied. +- Fixed: a preference write failure no longer changes the in-memory value the app keeps using. +- ARM64 CI runs the core unit tests (voice detector, resampler, identity, codecs) under qemu-aarch64 + (emulated, not native hardware). + ## 0.1.2 — 2026-10-24 - Fixed: Settings → Audio listed only the system default device. Electron reports the app origin as diff --git a/FEATURE_COMPATIBILITY.md b/FEATURE_COMPATIBILITY.md index ae4d341..a724524 100644 --- a/FEATURE_COMPATIBILITY.md +++ b/FEATURE_COMPATIBILITY.md @@ -14,6 +14,7 @@ UI, evidence path given; **implemented** = code + unit/loopback tests, no live p | Server password on connect | implemented, not exercised | the test server has no password | | Channel tree, join channel, password channels (inline prompt) | proven (join), implemented (password) | probe joined `cs`; no password test performed | | Voice TX/RX (Opus via core), talking indicators, mute, deafen RX+TX block/restore, PTT, open mic | proven between two TeamsPeach clients with synthetic capture | `docs/evidence/runtime/2026-10-24-voice-chat/`; the path after capture is real. Live microphone voice with the official TS6 client and Asahi hardware operation are not proven | +| Voice activation (local voice detector in the core, sensitivity High/Normal/Low, 100 ms preroll, 400 ms hangover) | proven between two TeamsPeach clients with a real speech recording as file-fed capture; detector unit tests on real speech and synthetic noise | `docs/evidence/runtime/2026-10-24-vad-dev/`, `docs/evidence/vad-0.1.3.md`: speech opens and silence closes the gate, mute/deafen/push-to-talk-not-held/disconnected send nothing, setting persists. A live microphone, an official TS6 receiver and native ARM64 hardware are not proven (ARM64 unit tests run under qemu) | | Private chat | proven | voice-chat run `15/16-*.png` | | Channel chat | proven error path | server denies guests: TS 2568, permission 224, shown in UI | | Server chat | implemented | not exercised live | diff --git a/LICENSES/NOTICE.md b/LICENSES/NOTICE.md index 8e34fef..b2a4918 100644 --- a/LICENSES/NOTICE.md +++ b/LICENSES/NOTICE.md @@ -6,5 +6,7 @@ (`LICENSE`, `LICENSES.chromium.html`), as placed there by electron-builder. - The native core (`teamspeach-core`, built on ReSpeak tsclientlib, libopus and other Rust crates) ships its complete third-party notices in `teamspeach-core-THIRD_PARTY_NOTICES.md` in this folder. + This includes the earshot voice detector (MIT OR Apache-2.0), whose crate embeds the small neural network + it runs (`weights.bin`) under the same license. - TeamSpeak is a trademark of TeamSpeak Systems GmbH. TeamsPeach is an independent client and is not affiliated with or endorsed by TeamSpeak Systems GmbH. diff --git a/README.md b/README.md index 0d35e50..7caa303 100644 --- a/README.md +++ b/README.md @@ -58,11 +58,20 @@ attached with a `local` designation and a `*-build-info.txt` provenance file. Edit names and addresses or remove entries in Settings → Servers. Server passwords are not saved; all servers use the same identity. 3. Click a channel to join it. Password-protected channels show a password field. -4. Voice uses push-to-talk (F8 by default, or the button in the channel header) or an open microphone. - The microphone and audio buttons at the bottom left update your server-visible mute state. - Right-click these buttons, or press Shift+F10 while focused, to select an input or output device using - the same selection as Settings → Audio. Left-click still mutes or deafens. The push-to-talk key works - **only while the TeamsPeach window is focused**; the hint in the channel header explains this. +4. Choose how your voice is sent in Settings → Audio → Voice transmission: + - **Push to talk** (default): hold F8 (change it in Settings → Keyboard) or the button in the channel + header. The key works **only while the TeamsPeach window is focused**; the header hint says so. + - **Voice activation**: a small voice detector built into TeamsPeach decides on this computer when you + are speaking and sends only then, from about 0.1 s before a detected word until about 0.4 s after the + last detected speech. Sensitivity: High (quieter speech), Normal, Low (noisier surroundings). It runs + after the microphone processing in the same panel (noise suppression, echo cancellation, gain + control). It is not speech recognition and saves nothing; loud speech-like sound (TV, other voices) + can also trigger it. + - **Open microphone**: continuous transmission. + The microphone test only shows the input level and never transmits. The microphone and audio buttons at + the bottom left update your server-visible mute state; muting or deafening stops transmission in every + mode. Right-click these buttons, or press Shift+F10 while focused, to select an input or output device + using the same selection as Settings → Audio. Left-click still mutes or deafens. 5. A streaming member has a Watch button. Volume, mute, fullscreen and Stop watching are below the video. The status line shows the negotiated codec, resolution and frame rate. diff --git a/app/main/ipc-validate.js b/app/main/ipc-validate.js index ccbdce2..37ecf71 100644 --- a/app/main/ipc-validate.js +++ b/app/main/ipc-validate.js @@ -118,6 +118,7 @@ const COMMANDS = { return out; }, set_audio: shape({ input_muted: optional(bool), output_muted: optional(bool) }), + set_transmit: shape({ mode: oneOf('direct', 'vad'), sensitivity: optional(oneOf('high', 'normal', 'low')) }), stream_list: shape({ client_id: optional(posInt) }), stream_join: shape({ stream_id: streamId, client_id: posInt, message: optional(str(0, 200)) }), stream_signal: shape({ stream_id: streamId, client_id: posInt, json: signalJson }), diff --git a/app/main/prefs.js b/app/main/prefs.js index 9b56406..5a79a34 100644 --- a/app/main/prefs.js +++ b/app/main/prefs.js @@ -9,7 +9,9 @@ const path = require('node:path'); */ const SCHEMA = { lastAddress: { default: '', check: (v) => typeof v === 'string' && v.length <= 255 && !/[\u0000-\u001f]/.test(v) }, - transmitMode: { default: 'ptt', check: (v) => v === 'ptt' || v === 'open' }, + // 'ptt' push-to-talk, 'open' continuous open microphone, 'vad' voice activation (the core's detector). + transmitMode: { default: 'ptt', check: (v) => v === 'ptt' || v === 'open' || v === 'vad' }, + vadSensitivity: { default: 'normal', check: (v) => v === 'high' || v === 'normal' || v === 'low' }, pttCode: { default: 'F8', check: (v) => typeof v === 'string' && /^[A-Za-z0-9]{1,32}$/.test(v) }, inputDeviceId: { default: '', check: (v) => typeof v === 'string' && v.length <= 512 }, outputDeviceId: { default: '', check: (v) => typeof v === 'string' && v.length <= 512 }, @@ -77,11 +79,12 @@ class Prefs { if (!spec.check(value)) throw new Error(`prefs: invalid value for ${key}`); next[key] = value; } - this.values = next; + // Persist first: if writing fails, neither the file nor the in-memory values change. fs.mkdirSync(path.dirname(this.file), { recursive: true }); const tmp = `${this.file}.tmp`; fs.writeFileSync(tmp, JSON.stringify(next, null, 2)); fs.renameSync(tmp, this.file); + this.values = next; return this.get(); } } diff --git a/app/renderer/index.html b/app/renderer/index.html index 715b6af..a0b8e27 100644 --- a/app/renderer/index.html +++ b/app/renderer/index.html @@ -300,6 +300,26 @@ +
+

Voice transmission

+
+ Transmission mode + + + +
+ +

The microphone test shows the input level, not whether speech is detected. The test itself never sends audio. In a channel, the selected transmission mode and mute controls determine when others hear you.

+

Microphone processing

@@ -342,14 +362,8 @@