Voice activation (core voice detector, set_transmit handshake), transmission mode in Settings → Audio, atomic prefs commit, ARM64 unit tests under qemu; version 0.1.3
This commit is contained in:
1 parent
8439fe062e
commit
b7951e0693
46 files changed
+1905
-191
No files matched your search
+36
-13
@@ -99,7 +99,7 @@ branch on human-readable message wording.
|
||||
| `audio_codec_unsupported` | current channel codec is not Opus (legacy Speex/CELT): we cannot transmit there (event, once per burst); received non-Opus voice is reported once per speaker |
|
||||
| `rename_not_persisted` | server accepted the new nickname but saving it failed; see §4.3 |
|
||||
| `not_found` | requested icon/avatar/banner does not exist (`detail.builtin:true` for built-in icon ids) |
|
||||
| `media_too_large` | file exceeds the size limit of its kind (§4.16) |
|
||||
| `media_too_large` | file exceeds the size limit of its kind (§4.17) |
|
||||
| `media_unsupported` | file is not a recognized image, or a banner reference the core cannot fetch |
|
||||
| `external_media` | banner or avatar lives at an `https://` URL (`detail.url` for banners, `detail.urls` for avatars); main may fetch it itself |
|
||||
| `io` | data dir I/O failure |
|
||||
@@ -195,20 +195,43 @@ Initial state at process start: both `false`.
|
||||
|
||||
One 20 ms microphone frame: base64 (standard alphabet, padded) of **960 signed
|
||||
16-bit little-endian mono samples at 48 kHz = 1920 bytes** (2560 base64 chars).
|
||||
The renderer gates push-to-talk / voice activation: it sends frames only while
|
||||
transmitting and `audio_end` when it stops. The core Opus-encodes 20 ms frames
|
||||
with the **current channel's codec**: Opus Voice (mono) or Opus Music (stereo — the
|
||||
In transmit mode `direct` (see 4.11) the renderer decides: it sends frames only while
|
||||
push-to-talk is held or the open microphone is on, and `audio_end` when it stops; the core
|
||||
sends every frame. In mode `vad` the renderer sends frames continuously while connected and
|
||||
not muted, and the core's voice detector decides which are sent. The core Opus-encodes 20 ms
|
||||
frames with the **current channel's codec**: Opus Voice (mono) or Opus Music (stereo — the
|
||||
mono frame is duplicated to both channels). Legacy Speex/CELT channels →
|
||||
`audio_codec_unsupported` event and nothing is sent. Outgoing queue bound: 10 frames
|
||||
(200 ms); on overflow the oldest frames are dropped (`audio_overflow` event).
|
||||
If no frame arrives for 200 ms during a burst the core ends the burst itself.
|
||||
Not connected → frames dropped with one `not_connected` error event per burst.
|
||||
Not connected → frames dropped with one `not_connected` error event per burst. Muted,
|
||||
deafened, or not allowed to talk by the server → frames dropped with one `audio_muted` event
|
||||
per burst; in mode `vad` the detector state and preroll are discarded as well.
|
||||
|
||||
### 4.10 `audio_end` — no args (no `id`, no response)
|
||||
|
||||
Ends the current transmission burst (core sends the TeamSpeak end-of-voice packet).
|
||||
Ends the current transmission burst (core sends the TeamSpeak end-of-voice packet). In mode
|
||||
`vad` it also discards the detector state and preroll (capture stopped or the renderer stopped
|
||||
forwarding).
|
||||
|
||||
### 4.11 `stream_list` — `{client_id?: number}`
|
||||
### 4.11 `set_transmit` — `{mode: "direct"|"vad", sensitivity?: "high"|"normal"|"low"}`
|
||||
|
||||
Selects who decides when voice is sent. `direct` (initial state at process start): every
|
||||
forwarded frame is sent. `vad`: voice activation in the core (`core/src/vad.rs`): frames are
|
||||
decimated to 16 kHz and scored by the earshot voice detector (embedded model, 16 ms windows,
|
||||
probability 0–1). The gate opens after 3 consecutive windows at or above the threshold
|
||||
(`high` 0.45, `normal` 0.6 — default, `low` 0.75) and sends the 5 frames (100 ms) held before
|
||||
the onset, then the current frame. While open, a window counts as voiced down to 0.15 below the
|
||||
threshold; the gate closes 20 frames (400 ms) after the last voiced frame. It cannot open
|
||||
during the first 10 frames after a reset. Detector, filter history and preroll are reset on
|
||||
every `set_transmit`, `audio_end`, mute/deafen, disconnect, channel or codec change and when
|
||||
the server does not allow talking. `sensitivity` is accepted only with `vad`.
|
||||
Before answering, the core discards frames still queued from the previous mode and ends any
|
||||
open burst; the renderer forwards nothing until it has this answer.
|
||||
Result `{"mode":"direct"}` or `{"mode":"vad","sensitivity":"normal"}`. `audio_state.transmitting`
|
||||
is true only while voice packets are actually being sent.
|
||||
|
||||
### 4.12 `stream_list` — `{client_id?: number}`
|
||||
|
||||
TS6 screenshare discovery. Sends `requeststreaminfo clid=<id>` for `client_id`, or for
|
||||
every other client in our current channel when omitted. Result:
|
||||
@@ -223,28 +246,28 @@ Live behaviour (TS6 6.0.0-beta13.1): every `requeststreaminfo` is answered `ok`,
|
||||
`viewer`, `viewer_limit`; for a non-streaming client the item has only `return_code`.
|
||||
So: "is streaming" ⇔ the `notifystreaminfo` item has `id`.
|
||||
|
||||
### 4.12 `stream_join` — `{stream_id: string, client_id: number, message?: string}`
|
||||
### 4.13 `stream_join` — `{stream_id: string, client_id: number, message?: string}`
|
||||
|
||||
Sends `joinstreamrequest id=<stream_id> clid=<client_id> msg=<message|our nickname> is_remove=0`.
|
||||
Result `{}` (or `server_error`). The SDP offer arrives as `stream` event
|
||||
`notifyrespondjoinstreamrequest` (`decision=1`, `offer=<sdp>`).
|
||||
|
||||
### 4.13 `stream_signal` — `{stream_id: string, client_id: number, json: object}`
|
||||
### 4.14 `stream_signal` — `{stream_id: string, client_id: number, json: object}`
|
||||
|
||||
Sends `streamsignaling id=<stream_id> clid=<client_id> json=<compact JSON of json>`.
|
||||
Examples of `json`: `{"cmd":"answer","args":{"answer":"<sdp>"}}`,
|
||||
`{"cmd":"iceCandidate","args":{"mLine":0,"mid":"0","sdp":"candidate:..."}}`.
|
||||
Max serialized `json` size 60 KiB (the whole stdin line is capped at 256 KiB). Result `{}` or `server_error`.
|
||||
|
||||
### 4.14 `stream_leave` — `{stream_id: string, client_id: number}`
|
||||
### 4.15 `stream_leave` — `{stream_id: string, client_id: number}`
|
||||
|
||||
Sends `joinstreamrequest id=… clid=… msg= is_remove=1`. Result `{}`.
|
||||
|
||||
### 4.15 `shutdown` — no args
|
||||
### 4.16 `shutdown` — no args
|
||||
|
||||
Disconnects cleanly if needed, responds `{}`, exits 0.
|
||||
|
||||
### 4.16 Media: `fetch_icon`, `fetch_avatar`, `fetch_banner`, `fetch_server_banner`
|
||||
### 4.17 Media: `fetch_icon`, `fetch_avatar`, `fetch_banner`, `fetch_server_banner`
|
||||
|
||||
Read-only downloads over TeamSpeak file transfer from the connected server. No paths
|
||||
cross the bridge: the core derives the server file from ids it already knows.
|
||||
@@ -328,7 +351,7 @@ Full replacement of the server view, emitted after connect and after every chang
|
||||
`"speex_ultrawideband"`, `"celt_mono"` or `null` if unknown. Only Opus channels can
|
||||
transmit; the UI should show the reason for others.
|
||||
- `client_type`: `"normal"` or `"query"`. `uid` may be `null` if not visible.
|
||||
- `icon_id`: TeamSpeak icon id or `null` (0 = none). Fetch with `fetch_icon` (§4.16).
|
||||
- `icon_id`: TeamSpeak icon id or `null` (0 = none). Fetch with `fetch_icon` (§4.17).
|
||||
- Groups: `server_groups`/`channel_groups` are the server's group catalogs (sent to every
|
||||
client on connect; sorted by `sort_id`, then `id`). A client's `server_groups` and
|
||||
`channel_group_id` reference them. `name_mode` (`none|before|after`) is TeamSpeak's
|
||||
|
||||
Reference in new issue
Block a user