Add a personal-account Tencent Meeting interview test bench.

The Tauri app vendors tmeet for browser OAuth, lists and creates meetings, launches the desktop client, and sends local playback audio to Doubao streaming ASR.
This commit is contained in:
zenord
2026-11-13 16:14:59 +08:00
commit a346827ea6
27 changed files with 7689 additions and 0 deletions
+5697
View File
File diff suppressed because it is too large Load Diff
+30
View File
@@ -0,0 +1,30 @@
[workspace]
members = [".", "core"]
resolver = "2"
[package]
name = "ookie-tx-meeting"
version = "0.1.0"
edition = "2021"
description = "Personal Tencent Meeting interview test bench"
license = "MIT"
[build-dependencies]
tauri-build = { version = "2", features = [] }
[dependencies]
ookie-tx-meeting-core = { path = "core" }
tauri = { version = "2", features = [] }
serde = { version = "1", features = ["derive"] }
serde_json = "1"
tokio = { version = "1", features = ["rt-multi-thread", "sync", "time", "macros"] }
# Linux uses the pure-Rust store so this machine can build without libdbus.
# Windows and macOS still use the OS credential store.
keyring = { version = "3", features = ["windows-native", "crypto-rust", "apple-native"] }
[target.'cfg(windows)'.dependencies]
wasapi = "=0.19.0"
[target.'cfg(not(windows))'.dependencies]
# Linux/macOS builds do not compile capture.rs's WASAPI path. The crate is
# declared so `cargo fetch` still resolves it for the Windows cross build.
+3
View File
@@ -0,0 +1,3 @@
fn main() {
tauri_build::build()
}
+8
View File
@@ -0,0 +1,8 @@
{
"$schema": "../gen/schemas/desktop-schema.json",
"identifier": "tx-meeting-local",
"description": "Local test window. No updater, no remote pages, no filesystem permissions.",
"windows": ["main"],
"local": true,
"permissions": ["core:default", "core:event:default"]
}
+15
View File
@@ -0,0 +1,15 @@
[package]
name = "ookie-tx-meeting-core"
version = "0.1.0"
edition = "2021"
description = "tmeet runner, join URL, and Doubao ASR framing. No GUI."
license = "MIT"
[dependencies]
serde = { version = "1", features = ["derive"] }
serde_json = "1"
tokio = { version = "1", features = ["rt-multi-thread", "sync", "time", "macros", "io-util", "process"] }
tokio-tungstenite = { version = "0.26", default-features = false, features = ["connect", "rustls-tls-native-roots"] }
futures-util = "0.3"
flate2 = "1"
uuid = { version = "1", features = ["v4"] }
+497
View File
@@ -0,0 +1,497 @@
//! Doubao streaming ASR (volcengine bigmodel_async).
//!
//! Wire format is the documented 4-byte header + big-endian payload size +
//! gzip payload. Audio is pcm_s16le, 16 kHz, mono, about 200 ms per packet.
//! Speaker ids returned here are Doubao clusters. They are not Tencent Meeting names.
use crate::error::{AppError, AppResult};
use serde::{Deserialize, Serialize};
use flate2::write::GzEncoder;
use flate2::read::GzDecoder;
use flate2::Compression;
use futures_util::{SinkExt, StreamExt};
use serde_json::{json, Value};
use std::io::{Read, Write};
use std::time::Duration;
use tokio::sync::mpsc;
use tokio_tungstenite::tungstenite::client::IntoClientRequest;
use tokio_tungstenite::tungstenite::http::HeaderValue;
use tokio_tungstenite::tungstenite::Message;
use uuid::Uuid;
pub const SAMPLE_RATE: u32 = 16_000;
/// Speech settings the GUI stores in the OS keyring. The core crate only consumes them.
#[derive(Debug, Clone, Serialize, Deserialize)]
pub struct SpeechSettings {
pub auth_mode: String,
pub api_key: String,
pub app_key: String,
pub access_key: String,
pub resource_id: String,
pub endpoint: String,
pub hotwords: String,
}
impl SpeechSettings {
pub fn validate(&self) -> AppResult<()> {
if !self.endpoint.starts_with("wss://") {
return Err(AppError::new("invalid_endpoint", "endpoint 必须以 wss:// 开头"));
}
if self.resource_id.trim().is_empty() {
return Err(AppError::new("invalid_resource", "资源 ID 不能为空"));
}
match self.auth_mode.as_str() {
"new" if self.api_key.trim().is_empty() => {
Err(AppError::new("credential_required", "新版控制台需要 API Key"))
}
"legacy" if self.app_key.trim().is_empty() || self.access_key.trim().is_empty() => {
Err(AppError::new("credential_required", "旧版控制台需要 App Key 和 Access Key"))
}
"new" | "legacy" => Ok(()),
_ => Err(AppError::new("invalid_auth_mode", "鉴权方式只能是 new 或 legacy")),
}
}
}
const PACKET_MS: u32 = 200;
pub const PACKET_BYTES: usize = (SAMPLE_RATE as usize) * (PACKET_MS as usize) / 1000 * 2;
const MSG_FULL_CLIENT: u8 = 0b0001;
const MSG_AUDIO_ONLY: u8 = 0b0010;
const MSG_FULL_SERVER: u8 = 0b1001;
const MSG_ERROR: u8 = 0b1111;
const FLAG_NONE: u8 = 0b0000;
const FLAG_LAST: u8 = 0b0010;
const SERIAL_JSON: u8 = 0b0001;
const SERIAL_NONE: u8 = 0b0000;
const COMPRESS_GZIP: u8 = 0b0001;
#[derive(Debug, Clone)]
pub struct TranscriptEvent {
pub text: String,
pub definite: bool,
pub speaker_id: Option<String>,
pub start_ms: Option<i64>,
pub end_ms: Option<i64>,
pub log_id: Option<String>,
pub raw_error: Option<String>,
}
pub fn hotwords(text: &str) -> Vec<Value> {
text.lines()
.map(str::trim)
.filter(|line| !line.is_empty())
.take(40)
.map(|word| json!({ "word": word }))
.collect()
}
fn header_insert(
headers: &mut tokio_tungstenite::tungstenite::http::HeaderMap,
name: &'static str,
value: &str,
label: &str,
) -> AppResult<()> {
headers.insert(
name,
HeaderValue::from_str(value).map_err(|_| {
AppError::new("invalid_credential", format!("{label} 含非法字符"))
})?,
);
Ok(())
}
fn gzip(bytes: &[u8]) -> AppResult<Vec<u8>> {
let mut encoder = GzEncoder::new(Vec::new(), Compression::default());
encoder
.write_all(bytes)
.map_err(|e| AppError::new("asr_frame_failed", e.to_string()))?;
encoder
.finish()
.map_err(|e| AppError::new("asr_frame_failed", e.to_string()))
}
fn gunzip(bytes: &[u8]) -> AppResult<Vec<u8>> {
let mut decoder = GzDecoder::new(bytes);
let mut out = Vec::new();
decoder
.read_to_end(&mut out)
.map_err(|e| AppError::new("asr_frame_failed", e.to_string()))?;
Ok(out)
}
fn header(message_type: u8, flags: u8, serialization: u8) -> [u8; 4] {
[
0b0001_0001, // version 1, header size 1 (4 bytes)
(message_type << 4) | flags,
(serialization << 4) | COMPRESS_GZIP,
0,
]
}
fn frame(message_type: u8, flags: u8, serialization: u8, payload: &[u8]) -> AppResult<Vec<u8>> {
let compressed = gzip(payload)?;
let mut out = Vec::with_capacity(8 + compressed.len());
out.extend_from_slice(&header(message_type, flags, serialization));
out.extend_from_slice(&(compressed.len() as u32).to_be_bytes());
out.extend_from_slice(&compressed);
Ok(out)
}
fn full_client_request(settings: &SpeechSettings) -> AppResult<Vec<u8>> {
let words = hotwords(&settings.hotwords);
let mut request = json!({
"model_name": "bigmodel",
"enable_itn": true,
"enable_punc": true,
"enable_ddc": false,
"show_utterances": true,
"enable_nonstream": true,
"enable_speaker_info": true,
"result_type": "full"
});
if !words.is_empty() {
request["corpus"] = json!({
"context": serde_json::to_string(&json!({ "hotwords": words })).unwrap_or_default()
});
}
let payload = json!({
"user": { "uid": "ookie-tx-meeting" },
"audio": {
"format": "pcm",
"codec": "raw",
"rate": SAMPLE_RATE,
"bits": 16,
"channel": 1
},
"request": request
});
frame(
MSG_FULL_CLIENT,
FLAG_NONE,
SERIAL_JSON,
payload.to_string().as_bytes(),
)
}
fn audio_frame(pcm: &[u8], last: bool) -> AppResult<Vec<u8>> {
frame(
MSG_AUDIO_ONLY,
if last { FLAG_LAST } else { FLAG_NONE },
SERIAL_NONE,
pcm,
)
}
/// Parse one server frame. Returns None for frames that carry no transcript yet.
pub fn parse_server_frame(bytes: &[u8]) -> AppResult<Option<TranscriptEvent>> {
if bytes.len() < 8 {
return Err(AppError::new("asr_frame_failed", "响应帧过短"));
}
let message_type = bytes[1] >> 4;
let flags = bytes[1] & 0x0f;
let compression = bytes[3] & 0x0f;
let header_bytes = ((bytes[0] & 0x0f) as usize) * 4;
if message_type == MSG_ERROR {
let code = if bytes.len() >= header_bytes + 4 {
u32::from_be_bytes(bytes[header_bytes..header_bytes + 4].try_into().unwrap())
} else {
0
};
return Ok(Some(TranscriptEvent {
text: String::new(),
definite: true,
speaker_id: None,
start_ms: None,
end_ms: None,
log_id: None,
raw_error: Some(format!("豆包返回错误 {code}")),
}));
}
if message_type != MSG_FULL_SERVER {
return Ok(None);
}
let mut offset = header_bytes;
if flags & 0b0001 != 0 {
offset += 4; // sequence number
}
if offset + 4 > bytes.len() {
return Err(AppError::new("asr_frame_failed", "响应帧缺少长度"));
}
let size = u32::from_be_bytes(bytes[offset..offset + 4].try_into().unwrap()) as usize;
offset += 4;
if offset + size > bytes.len() {
return Err(AppError::new("asr_frame_failed", "响应帧长度不一致"));
}
let payload = &bytes[offset..offset + size];
let json_bytes = if compression == COMPRESS_GZIP {
gunzip(payload)?
} else {
payload.to_vec()
};
let value: Value = serde_json::from_slice(&json_bytes)
.map_err(|e| AppError::new("asr_frame_failed", e.to_string()))?;
Ok(event_from_payload(&value))
}
fn event_from_payload(value: &Value) -> Option<TranscriptEvent> {
let msg = value.get("payload_msg").unwrap_or(value);
let result = msg.get("result")?;
let text = result.get("text").and_then(Value::as_str).unwrap_or("").to_string();
let log_id = result
.pointer("/additions/log_id")
.and_then(Value::as_str)
.map(str::to_string);
let utterance = result
.get("utterances")
.and_then(Value::as_array)
.and_then(|items| items.last());
let definite = utterance
.and_then(|u| u.get("definite"))
.and_then(Value::as_bool)
.unwrap_or(false);
let speaker_id = utterance
.and_then(|u| u.pointer("/additions/speaker_id"))
.and_then(Value::as_str)
.map(str::to_string);
let start_ms = utterance.and_then(|u| u.get("start_time")).and_then(Value::as_i64);
let end_ms = utterance.and_then(|u| u.get("end_time")).and_then(Value::as_i64);
if text.is_empty() && !definite {
return None;
}
Some(TranscriptEvent {
text,
definite,
speaker_id,
start_ms,
end_ms,
log_id,
raw_error: None,
})
}
pub struct AsrSession {
pub events: mpsc::Receiver<TranscriptEvent>,
audio: mpsc::Sender<Vec<u8>>,
}
impl AsrSession {
pub async fn connect(settings: SpeechSettings) -> AppResult<Self> {
settings.validate()?;
let (audio_tx, audio_rx) = mpsc::channel::<Vec<u8>>(32);
let (event_tx, event_rx) = mpsc::channel::<TranscriptEvent>(64);
let request = full_client_request(&settings)?;
let url = settings.endpoint.clone();
let resource_id = settings.resource_id.clone();
let auth_mode = settings.auth_mode.clone();
let api_key = settings.api_key.clone();
let app_key = settings.app_key.clone();
let access_key = settings.access_key.clone();
tokio::spawn(async move {
if let Err(err) = drive(
&url,
&resource_id,
&auth_mode,
&api_key,
&app_key,
&access_key,
request,
audio_rx,
event_tx.clone(),
)
.await
{
let _ = event_tx
.send(TranscriptEvent {
text: String::new(),
definite: true,
speaker_id: None,
start_ms: None,
end_ms: None,
log_id: None,
raw_error: Some(err.detail),
})
.await;
}
});
Ok(Self {
events: event_rx,
audio: audio_tx,
})
}
pub async fn push(&self, pcm: Vec<u8>) -> AppResult<()> {
self.audio
.send(pcm)
.await
.map_err(|_| AppError::new("asr_closed", "识别连接已关闭"))
}
pub fn finish(&self) {
// Dropping the sender makes the driver send the final empty packet.
}
}
async fn drive(
url: &str,
resource_id: &str,
auth_mode: &str,
api_key: &str,
app_key: &str,
access_key: &str,
first: Vec<u8>,
mut audio_rx: mpsc::Receiver<Vec<u8>>,
event_tx: mpsc::Sender<TranscriptEvent>,
) -> AppResult<()> {
let mut request = url
.into_client_request()
.map_err(|e| AppError::new("asr_connect_failed", e.to_string()))?;
let headers = request.headers_mut();
header_insert(headers, "X-Api-Resource-Id", resource_id, "资源 ID")?;
header_insert(headers, "X-Api-Request-Id", &Uuid::new_v4().to_string(), "请求 ID")?;
if auth_mode == "legacy" {
header_insert(headers, "X-Api-App-Key", app_key, "App Key")?;
header_insert(headers, "X-Api-Access-Key", access_key, "Access Key")?;
} else {
header_insert(headers, "X-Api-Key", api_key, "API Key")?;
}
let (mut socket, response) = tokio::time::timeout(
Duration::from_secs(15),
tokio_tungstenite::connect_async(request),
)
.await
.map_err(|_| AppError::new("asr_connect_failed", "连接豆包超时"))?
.map_err(|e| AppError::new("asr_connect_failed", e.to_string()))?;
let log_id = response
.headers()
.get("X-Tt-Logid")
.and_then(|v| v.to_str().ok())
.map(str::to_string);
socket
.send(Message::Binary(first.into()))
.await
.map_err(|e| AppError::new("asr_send_failed", e.to_string()))?;
let mut pending = Vec::new();
loop {
tokio::select! {
incoming = socket.next() => {
match incoming {
Some(Ok(Message::Binary(bytes))) => {
if let Some(mut event) = parse_server_frame(&bytes)? {
if event.log_id.is_none() {
event.log_id = log_id.clone();
}
if event.raw_error.is_some() {
let _ = event_tx.send(event).await;
return Ok(());
}
let _ = event_tx.send(event).await;
}
}
Some(Ok(Message::Close(_))) | None => break,
Some(Err(e)) => return Err(AppError::new("asr_closed", e.to_string())),
_ => {}
}
}
packet = audio_rx.recv() => {
match packet {
Some(pcm) => {
pending.extend_from_slice(&pcm);
while pending.len() >= PACKET_BYTES {
let chunk: Vec<u8> = pending.drain(..PACKET_BYTES).collect();
let frame = audio_frame(&chunk, false)?;
socket.send(Message::Binary(frame.into())).await
.map_err(|e| AppError::new("asr_send_failed", e.to_string()))?;
}
}
None => {
let frame = audio_frame(&pending, true)?;
socket.send(Message::Binary(frame.into())).await
.map_err(|e| AppError::new("asr_send_failed", e.to_string()))?;
pending.clear();
// Drain a little longer so the final utterance can arrive.
let _ = tokio::time::timeout(Duration::from_secs(8), async {
while let Some(msg) = socket.next().await {
if let Ok(Message::Binary(bytes)) = msg {
if let Ok(Some(event)) = parse_server_frame(&bytes) {
let _ = event_tx.send(event).await;
}
}
}
}).await;
break;
}
}
}
}
}
Ok(())
}
/// Resample interleaved s16le PCM to 16 kHz mono with linear interpolation.
pub fn to_16k_mono(input: &[u8], channels: u16, rate: u32) -> Vec<u8> {
if input.len() < 2 || channels == 0 || rate == 0 {
return Vec::new();
}
let frame_bytes = channels as usize * 2;
let frames = input.len() / frame_bytes;
if frames == 0 {
return Vec::new();
}
let mut mono = Vec::with_capacity(frames);
for i in 0..frames {
let mut sum = 0i32;
for c in 0..channels as usize {
let off = i * frame_bytes + c * 2;
let sample = i16::from_le_bytes([input[off], input[off + 1]]) as i32;
sum += sample;
}
mono.push((sum / channels as i32) as i16);
}
if rate == SAMPLE_RATE {
return mono.iter().flat_map(|s| s.to_le_bytes()).collect();
}
let out_len = ((mono.len() as u64) * SAMPLE_RATE as u64 / rate as u64) as usize;
let mut out = Vec::with_capacity(out_len * 2);
for i in 0..out_len {
let src = (i as f64) * (rate as f64) / (SAMPLE_RATE as f64);
let idx = src.floor() as usize;
let frac = src - idx as f64;
let a = mono[idx.min(mono.len() - 1)] as f64;
let b = mono[(idx + 1).min(mono.len() - 1)] as f64;
let sample = (a + (b - a) * frac).round() as i16;
out.extend_from_slice(&sample.to_le_bytes());
}
out
}
#[cfg(test)]
mod tests {
use super::*;
#[test]
fn resamples_stereo_48k_down_to_16k_mono() {
let mut stereo = Vec::new();
for i in 0..48u16 {
stereo.extend_from_slice(&(i as i16).to_le_bytes());
stereo.extend_from_slice(&(i as i16).to_le_bytes());
}
let out = to_16k_mono(&stereo, 2, 48_000);
assert_eq!(out.len(), 32); // 16 samples * 2 bytes
}
#[test]
fn rejects_a_short_server_frame() {
assert!(parse_server_frame(&[0, 1, 2]).is_err());
}
}
+31
View File
@@ -0,0 +1,31 @@
use serde::Serialize;
/// Errors that cross the Tauri command boundary. The frontend only sees `code`.
#[derive(Debug, Serialize)]
pub struct AppError {
pub code: String,
pub detail: String,
}
impl AppError {
pub fn new(code: impl Into<String>, detail: impl Into<String>) -> Self {
Self {
code: code.into(),
detail: detail.into(),
}
}
}
impl std::fmt::Display for AppError {
fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
write!(f, "{}: {}", self.code, self.detail)
}
}
impl From<AppError> for String {
fn from(value: AppError) -> Self {
serde_json::to_string(&value).unwrap_or_else(|_| value.code.clone())
}
}
pub type AppResult<T> = Result<T, AppError>;
+89
View File
@@ -0,0 +1,89 @@
use crate::error::{AppError, AppResult};
use serde::Serialize;
use std::process::Command;
#[derive(Debug, Serialize)]
pub struct LaunchPlan {
pub meeting_code: String,
pub url: String,
pub command: String,
pub launched: bool,
pub note: String,
}
/// Personal-account join URL. This is a public client scheme, not an MCP call.
/// Windows: `cmd /C start`, macOS: `open`. Other platforms only return the URL.
pub fn client_url(meeting_code: &str) -> AppResult<String> {
let digits: String = meeting_code.chars().filter(|c| c.is_ascii_digit()).collect();
if digits.len() < 9 || digits.len() > 12 {
return Err(AppError::new(
"invalid_meeting_code",
"会议号应为 9–12 位数字",
));
}
Ok(format!("wemeet://page/inmeeting?meeting_code={digits}"))
}
pub fn launch(meeting_code: &str) -> AppResult<LaunchPlan> {
let url = client_url(meeting_code)?;
let digits: String = meeting_code.chars().filter(|c| c.is_ascii_digit()).collect();
if cfg!(target_os = "linux") {
return Ok(LaunchPlan {
meeting_code: digits,
url: url.clone(),
command: format!("start \"\" \"{url}\""),
launched: false,
note: "当前是 Linux,无法唤起 PC/Mac 腾讯会议。把链接拿到已安装客户端的电脑上打开。".into(),
});
}
let mut command = if cfg!(windows) {
let mut cmd = Command::new("cmd");
cmd.args(["/C", "start", "", &url]);
cmd
} else {
let mut cmd = Command::new("open");
cmd.arg(&url);
cmd
};
match command.spawn() {
Ok(child) => {
drop(child);
Ok(LaunchPlan {
meeting_code: digits,
url,
command: if cfg!(windows) {
"cmd /C start".into()
} else {
"open".into()
},
launched: true,
note: "已请求系统打开腾讯会议。若客户端未安装或未登录,这次唤起不会入会。".into(),
})
}
Err(e) => Err(AppError::new("launch_failed", e.to_string())),
}
}
/// Bring the installed client to the front before OAuth, so the user can confirm
/// the personal account. Failure here is not fatal: auth still happens in the browser.
pub fn focus_client() -> AppResult<String> {
if cfg!(target_os = "linux") {
return Ok("Linux 上无法拉起腾讯会议客户端。授权仍在浏览器完成。".into());
}
let url = "wemeet://page/home";
let result = if cfg!(windows) {
Command::new("cmd").args(["/C", "start", "", url]).spawn()
} else {
Command::new("open").arg(url).spawn()
};
match result {
Ok(child) => {
drop(child);
Ok("已尝试拉起腾讯会议。请确认客户端登录的是个人账号,再回浏览器完成授权。".into())
}
Err(e) => Ok(format!("拉起客户端失败({e})。可直接在浏览器完成授权。")),
}
}
+24
View File
@@ -0,0 +1,24 @@
pub mod asr;
pub mod error;
pub mod launch;
pub mod tmeet;
pub use error::{AppError, AppResult};
#[cfg(test)]
mod tests {
use super::tmeet::not_logged_in;
#[test]
fn logged_out_text_is_not_a_session() {
assert!(not_logged_in(
"Not logged in. Please use 'tmeet auth login' to authenticate.\n",
""
));
assert!(not_logged_in(
"",
"Error: user config is empty, please use 'tmeet auth login'"
));
assert!(!not_logged_in(r#"{"open_id":"abc"}"#, ""));
}
}
+182
View File
@@ -0,0 +1,182 @@
use crate::error::{AppError, AppResult};
use serde_json::Value;
use std::path::{Path, PathBuf};
use std::process::Stdio;
use std::time::Duration;
use tokio::io::{AsyncRead, AsyncReadExt};
use tokio::process::Command;
const MAX_OUTPUT: usize = 4 * 1024 * 1024;
/// Locate the vendored tmeet binary.
///
/// Dev: `vendor/tmeet/<platform>/tmeet[.exe]`, walked up from the executable
/// and from the current directory.
/// Packaged: `tmeet[.exe]` beside the application executable.
pub fn locate() -> AppResult<PathBuf> {
let exe_name = if cfg!(windows) { "tmeet.exe" } else { "tmeet" };
let platform_dir = platform_dir();
let mut candidates = Vec::new();
if let Ok(exe) = std::env::current_exe() {
if let Some(dir) = exe.parent() {
candidates.push(dir.join(exe_name));
candidates.push(dir.join("vendor").join("tmeet").join(platform_dir).join(exe_name));
}
}
if let Ok(cwd) = std::env::current_dir() {
candidates.push(cwd.join("vendor").join("tmeet").join(platform_dir).join(exe_name));
let mut cursor = cwd.as_path();
for _ in 0..4 {
candidates.push(cursor.join("vendor").join("tmeet").join(platform_dir).join(exe_name));
match cursor.parent() {
Some(parent) => cursor = parent,
None => break,
}
}
}
candidates
.into_iter()
.find(|path| path.is_file())
.ok_or_else(|| {
AppError::new(
"tmeet_missing",
"找不到内置的 tmeet。开发时它应在 vendor/tmeet/<平台>/ 下。",
)
})
}
fn platform_dir() -> &'static str {
if cfg!(windows) {
"windows-x86_64"
} else if cfg!(target_os = "macos") {
if cfg!(target_arch = "aarch64") {
"macos-aarch64"
} else {
"macos-x86_64"
}
} else if cfg!(target_arch = "aarch64") {
"linux-aarch64"
} else {
"linux-x86_64"
}
}
pub struct TmeetOutput {
pub status: i32,
pub stdout: String,
pub stderr: String,
pub json: Option<Value>,
}
/// Run tmeet. `timeout` bounds the call; login uses a longer one because it
/// waits for the browser OAuth round-trip (the CLI itself times out at 5 min).
pub async fn run(args: &[&str], timeout: Duration) -> AppResult<TmeetOutput> {
let bin = locate()?;
run_at(&bin, args, timeout).await
}
pub async fn run_at(bin: &Path, args: &[&str], timeout: Duration) -> AppResult<TmeetOutput> {
let mut command = Command::new(bin);
command
.args(args)
.stdin(Stdio::null())
.stdout(Stdio::piped())
.stderr(Stdio::piped())
.kill_on_drop(true);
#[cfg(windows)]
{
command.creation_flags(0x08000000); // CREATE_NO_WINDOW
}
let mut child = command
.spawn()
.map_err(|e| AppError::new("tmeet_spawn_failed", e.to_string()))?;
let mut stdout = child.stdout.take().ok_or_else(|| {
AppError::new("tmeet_spawn_failed", "无法读取 tmeet 标准输出")
})?;
let mut stderr = child.stderr.take().ok_or_else(|| {
AppError::new("tmeet_spawn_failed", "无法读取 tmeet 标准错误")
})?;
let stdout_task = tokio::spawn(async move { read_capped(&mut stdout).await });
let stderr_task = tokio::spawn(async move { read_capped(&mut stderr).await });
let status = tokio::time::timeout(timeout, child.wait())
.await
.map_err(|_| AppError::new("tmeet_timeout", "tmeet 超时未返回"))?
.map_err(|e| AppError::new("tmeet_failed", e.to_string()))?;
let stdout = stdout_task
.await
.map_err(|e| AppError::new("tmeet_failed", e.to_string()))??;
let stderr = stderr_task
.await
.map_err(|e| AppError::new("tmeet_failed", e.to_string()))??;
let json = parse_json(&stdout);
Ok(TmeetOutput {
status: status.code().unwrap_or(-1),
stdout,
stderr,
json,
})
}
async fn read_capped(reader: &mut (impl AsyncRead + Unpin)) -> AppResult<String> {
let mut buf = Vec::new();
let mut chunk = [0u8; 8192];
loop {
let n = reader
.read(&mut chunk)
.await
.map_err(|e| AppError::new("tmeet_failed", e.to_string()))?;
if n == 0 {
break;
}
if buf.len() + n > MAX_OUTPUT {
return Err(AppError::new("tmeet_output_limit", "tmeet 输出超过 4MB"));
}
buf.extend_from_slice(&chunk[..n]);
}
Ok(String::from_utf8_lossy(&buf).into_owned())
}
pub fn not_logged_in(stdout: &str, stderr: &str) -> bool {
let blob = format!("{stdout}\n{stderr}").to_ascii_lowercase();
blob.contains("not logged in") || blob.contains("user config is empty")
}
fn parse_json(stdout: &str) -> Option<Value> {
let trimmed = stdout.trim();
if trimmed.is_empty() {
return None;
}
serde_json::from_str(trimmed).ok().or_else(|| {
// Some commands print a hint after the JSON array. Take the first JSON value.
let start = trimmed.find(['{', '['])?;
let slice = &trimmed[start..];
serde_json::from_str(slice).ok()
})
}
pub fn require_ok(output: TmeetOutput) -> AppResult<TmeetOutput> {
if output.status != 0 {
let detail = if !output.stderr.trim().is_empty() {
output.stderr.trim().to_string()
} else {
output.stdout.trim().to_string()
};
return Err(AppError::new(
"tmeet_failed",
if detail.is_empty() {
format!("tmeet 退出码 {}", output.status)
} else {
detail
},
));
}
Ok(output)
}
Binary file not shown.

After

Width:  |  Height:  |  Size: 40 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 90 KiB

+150
View File
@@ -0,0 +1,150 @@
//! Loopback capture of the default playback device.
//!
//! Windows uses WASAPI loopback: open the render endpoint, then initialize a
//! capture client on it. That is "what you hear", not a single process.
//! macOS has no system loopback. Linux has no Tencent Meeting client to capture.
use ookie_tx_meeting_core::asr::{to_16k_mono, AsrSession, SAMPLE_RATE};
use ookie_tx_meeting_core::error::{AppError, AppResult};
use tokio::sync::mpsc;
pub fn platform_note() -> &'static str {
if cfg!(windows) {
"Windows:采集默认播放设备。腾讯会议的声音和其他正在播放的声音都会进去。面试时不要放别的音频。"
} else if cfg!(target_os = "macos") {
"macOS 没有系统回环。请先安装 BlackHole,把腾讯会议的输出指到它。本原型不假装能直接采。"
} else {
"当前是 Linux,没有可采集的腾讯会议播放输出。用「测试识别」跑 fixture,或在 Windows 真机上采集。"
}
}
pub async fn capture_to(session: AsrSession, stop: mpsc::Receiver<()>) -> AppResult<()> {
#[cfg(windows)]
{
capture_wasapi(session, stop).await
}
#[cfg(not(windows))]
{
let _ = (session, stop);
Err(AppError::new("capture_unavailable", platform_note()))
}
}
#[cfg(windows)]
async fn capture_wasapi(session: AsrSession, mut stop: mpsc::Receiver<()>) -> AppResult<()> {
let (tx, mut rx) = mpsc::channel::<Vec<u8>>(16);
let (ready_tx, ready_rx) = tokio::sync::oneshot::channel::<Result<(), String>>();
std::thread::spawn(move || {
let result = wasapi_thread(tx);
let _ = ready_tx.send(result);
});
match ready_rx.await {
Ok(Ok(())) => {}
Ok(Err(detail)) => return Err(AppError::new("capture_failed", detail)),
Err(_) => return Err(AppError::new("capture_failed", "采集线程退出")),
}
loop {
tokio::select! {
packet = rx.recv() => {
match packet {
Some(pcm) => session.push(pcm).await?,
None => break,
}
}
_ = stop.recv() => break,
}
}
Ok(())
}
#[cfg(windows)]
fn wasapi_thread(tx: mpsc::Sender<Vec<u8>>) -> Result<(), String> {
use wasapi::{DeviceCollection, Direction, SampleType, StreamMode, WaveFormat};
let hr = wasapi::initialize_mta();
if hr.is_err() {
return Err(format!("COM 初始化失败: {hr:?}"));
}
// 0.19 has no DeviceEnumerator. The first active render device is the default output.
let collection = DeviceCollection::new(&Direction::Render).map_err(|e| e.to_string())?;
let device = collection
.get_device_at_index(0)
.map_err(|e| format!("找不到播放设备: {e}"))?;
let mut audio_client = device.get_iaudioclient().map_err(|e| format!("无法打开播放设备: {e}"))?;
let mix = audio_client.get_mixformat().map_err(|e| format!("无法读取混音格式: {e}"))?;
let channels = mix.get_nchannels();
let rate = mix.get_samplespersec();
let sample_type = mix.get_subformat().map_err(|e| format!("无法识别采样格式: {e}"))?;
let desired = WaveFormat::new(
mix.get_bitspersample() as usize,
mix.get_validbitspersample() as usize,
&sample_type,
rate as usize,
channels as usize,
None,
);
let (default_period, _) = audio_client.get_device_period().map_err(|e| e.to_string())?;
let mode = StreamMode::EventsShared {
autoconvert: true,
buffer_duration_hns: default_period.max(200_000),
};
audio_client
.initialize_client(&desired, &Direction::Capture, &mode)
.map_err(|e| format!("初始化回环失败: {e}"))?;
let capture = audio_client.get_audiocaptureclient().map_err(|e| e.to_string())?;
let event = audio_client.set_get_eventhandle().map_err(|e| e.to_string())?;
audio_client.start_stream().map_err(|e| format!("无法开始采集: {e}"))?;
let mut acc = Vec::new();
let mut scratch = vec![0u8; 64 * 1024];
loop {
if tx.is_closed() {
break;
}
if event.wait_for_event(500).is_err() {
if tx.is_closed() {
break;
}
continue;
}
let (frames, _) = match capture.read_from_device(&mut scratch) {
Ok(read) => read,
Err(_) => break,
};
let byte_count = frames as usize * mix.get_blockalign() as usize;
if frames == 0 || byte_count == 0 || byte_count > scratch.len() {
continue;
}
let chunk = &scratch[..byte_count];
let pcm = if sample_type == SampleType::Float {
f32_bytes_to_s16(chunk, channels, rate)
} else {
to_16k_mono(chunk, channels, rate)
};
acc.extend_from_slice(&pcm);
let packet = (SAMPLE_RATE as usize) * 2 / 5; // 200 ms
while acc.len() >= packet {
let send: Vec<u8> = acc.drain(..packet).collect();
if tx.blocking_send(send).is_err() {
let _ = audio_client.stop_stream();
return Ok(());
}
}
}
let _ = audio_client.stop_stream();
Ok(())
}
#[cfg(windows)]
fn f32_bytes_to_s16(input: &[u8], channels: u16, rate: u32) -> Vec<u8> {
let mut s16 = Vec::with_capacity(input.len() / 2);
for frame in input.chunks_exact(4) {
let sample = f32::from_le_bytes([frame[0], frame[1], frame[2], frame[3]]);
let clipped = (sample.clamp(-1.0, 1.0) * i16::MAX as f32) as i16;
s16.extend_from_slice(&clipped.to_le_bytes());
}
to_16k_mono(&s16, channels, rate)
}
+372
View File
@@ -0,0 +1,372 @@
use crate::capture;
use crate::settings;
use ookie_tx_meeting_core::asr::SpeechSettings;
use ookie_tx_meeting_core::asr::{AsrSession, TranscriptEvent};
use ookie_tx_meeting_core::error::{AppError, AppResult};
use ookie_tx_meeting_core::launch;
use ookie_tx_meeting_core::tmeet;
use serde::Serialize;
use serde_json::{json, Value};
use std::sync::atomic::{AtomicBool, Ordering};
use std::time::Duration;
use tauri::{AppHandle, Emitter, State};
use tokio::sync::{mpsc, Mutex};
pub struct AppState {
pub capturing: AtomicBool,
stop_capture: Mutex<Option<mpsc::Sender<()>>>,
}
impl Default for AppState {
fn default() -> Self {
Self {
capturing: AtomicBool::new(false),
stop_capture: Mutex::new(None),
}
}
}
fn emit_transcript(app: &AppHandle, event: &TranscriptEvent, source: &str) {
let _ = app.emit(
"transcript",
json!({
"source": source,
"text": event.text,
"definite": event.definite,
"speakerId": event.speaker_id,
"startMs": event.start_ms,
"endMs": event.end_ms,
"logId": event.log_id,
"error": event.raw_error,
"speakerNote": "豆包的说话人编号不是腾讯会议里的人名"
}),
);
}
async fn forward_events(app: AppHandle, mut events: mpsc::Receiver<TranscriptEvent>, source: String) {
while let Some(event) = events.recv().await {
emit_transcript(&app, &event, &source);
}
let _ = app.emit("transcript-closed", json!({ "source": source }));
}
#[derive(Serialize)]
pub struct AuthView {
pub logged_in: bool,
pub summary: String,
pub raw: Value,
}
#[tauri::command]
pub async fn app_info() -> Value {
json!({
"name": "OOKIE 腾讯会议测试台",
"account": "个人版",
"limits": [
"个人版没有会中实时转写 API,字幕来自本机播放声音 + 豆包",
"个人版没有直播在线花名册,会中只能看到受邀人和等候室记录",
"豆包说话人编号对不上腾讯会议人名",
"授权在浏览器完成,拉起客户端只用来核对登录账号"
],
"capture": capture::platform_note()
})
}
#[tauri::command]
pub async fn tmeet_status() -> AppResult<AuthView> {
let output = tmeet::run(&["--format", "json", "auth", "status"], Duration::from_secs(20)).await?;
// v1.1.0 prints "Not logged in" and still exits 0. Do not trust the exit code alone.
let logged_in = output.status == 0 && !tmeet::not_logged_in(&output.stdout, &output.stderr);
Ok(AuthView {
logged_in,
summary: if logged_in {
"已登录".into()
} else {
"未登录".into()
},
raw: output.json.unwrap_or(json!({ "stdout": output.stdout, "stderr": output.stderr })),
})
}
#[tauri::command]
pub async fn tmeet_login() -> AppResult<Value> {
let focus = launch::focus_client()?;
// The CLI blocks until the browser flow finishes or its own 5-minute timer fires.
let output = tmeet::run(
&["--format", "json", "auth", "login"],
Duration::from_secs(330),
)
.await?;
if output.status != 0 {
return Err(AppError::new(
"login_failed",
format!(
"{}\n{}",
output.stderr.trim(),
output.stdout.trim()
),
));
}
Ok(json!({
"focus": focus,
"stdout": output.stdout,
"stderr": output.stderr
}))
}
#[tauri::command]
pub async fn tmeet_logout() -> AppResult<Value> {
let output = tmeet::require_ok(
tmeet::run(&["--format", "json", "auth", "logout"], Duration::from_secs(30)).await?,
)?;
Ok(output.json.unwrap_or(json!({ "stdout": output.stdout })))
}
#[tauri::command]
pub async fn meeting_list() -> AppResult<Value> {
let output = tmeet::require_ok(
tmeet::run(
&["--format", "json", "meeting", "list", "--page-size", "20"],
Duration::from_secs(30),
)
.await?,
)?;
Ok(output.json.unwrap_or(json!({ "stdout": output.stdout })))
}
#[tauri::command]
pub async fn meeting_create(subject: String, start: String, end: String) -> AppResult<Value> {
if subject.trim().is_empty() || subject.chars().count() > 80 {
return Err(AppError::new("invalid_subject", "主题不能为空,且不超过 80 字"));
}
if !looks_like_iso(&start) || !looks_like_iso(&end) {
return Err(AppError::new(
"invalid_time",
"时间用 ISO 8601,例如 2026-11-14T15:00:00+08:00",
));
}
let output = tmeet::require_ok(
tmeet::run(
&[
"--format",
"json",
"meeting",
"create",
"--subject",
subject.trim(),
"--start",
start.trim(),
"--end",
end.trim(),
],
Duration::from_secs(40),
)
.await?,
)?;
Ok(output.json.unwrap_or(json!({ "stdout": output.stdout })))
}
fn looks_like_iso(value: &str) -> bool {
let v = value.trim();
v.len() >= 16 && v.len() <= 40 && v.contains('T') && !v.contains(['\n', '\r', '"'])
}
#[tauri::command]
pub async fn meeting_get(meeting_code: String) -> AppResult<Value> {
let code = digits(&meeting_code)?;
let output = tmeet::require_ok(
tmeet::run(
&["--format", "json", "meeting", "get", "--meeting-code", &code],
Duration::from_secs(30),
)
.await?,
)?;
Ok(output.json.unwrap_or(json!({ "stdout": output.stdout })))
}
#[tauri::command]
pub async fn meeting_cancel(meeting_id: String) -> AppResult<Value> {
let id = meeting_id.trim();
if id.is_empty() || id.len() > 64 || id.contains([' ', '\n', '"']) {
return Err(AppError::new("invalid_meeting_id", "会议 ID 不合法"));
}
let output = tmeet::require_ok(
tmeet::run(
&["--format", "json", "meeting", "cancel", "--meeting-id", id],
Duration::from_secs(30),
)
.await?,
)?;
Ok(output.json.unwrap_or(json!({ "stdout": output.stdout })))
}
#[tauri::command]
pub async fn meeting_launch(meeting_code: String) -> AppResult<launch::LaunchPlan> {
launch::launch(&meeting_code)
}
#[tauri::command]
pub async fn meeting_people(meeting_id: String) -> AppResult<Value> {
let id = meeting_id.trim();
if id.is_empty() || id.len() > 64 || id.contains([' ', '\n', '"']) {
return Err(AppError::new("invalid_meeting_id", "会议 ID 不合法"));
}
let invitees = tmeet::run(
&[
"--format",
"json",
"meeting",
"invitees-list",
"--meeting-id",
id,
],
Duration::from_secs(30),
)
.await?;
let participants = tmeet::run(
&[
"--format",
"json",
"report",
"participants",
"--meeting-id",
id,
],
Duration::from_secs(30),
)
.await?;
let waiting = tmeet::run(
&[
"--format",
"json",
"report",
"waiting-room-log",
"--meeting-id",
id,
],
Duration::from_secs(30),
)
.await?;
Ok(json!({
"invitees": invitees.json.unwrap_or(json!({ "stdout": invitees.stdout, "stderr": invitees.stderr, "status": invitees.status })),
"participants": participants.json.unwrap_or(json!({ "stdout": participants.stdout, "stderr": participants.stderr, "status": participants.status })),
"waitingRoom": waiting.json.unwrap_or(json!({ "stdout": waiting.stdout, "stderr": waiting.stderr, "status": waiting.status })),
"note": "参会明细是入会/离会记录,不是直播在线花名册。会还没开始时为空是正常的。"
}))
}
fn digits(value: &str) -> AppResult<String> {
let code: String = value.chars().filter(|c| c.is_ascii_digit()).collect();
if code.len() < 9 || code.len() > 12 {
return Err(AppError::new("invalid_meeting_code", "会议号应为 9–12 位数字"));
}
Ok(code)
}
#[tauri::command]
pub fn speech_get() -> Value {
serde_json::to_value(settings::view(&settings::load())).unwrap_or(json!({}))
}
#[tauri::command]
pub fn speech_save(incoming: SpeechSettings) -> AppResult<Value> {
let previous = settings::load();
let next = settings::merge_secrets(incoming, &previous);
settings::save(&next)?;
Ok(serde_json::to_value(settings::view(&next)).unwrap_or(json!({})))
}
#[tauri::command]
pub async fn speech_test(app: AppHandle) -> AppResult<Value> {
let settings = settings::load();
settings.validate()?;
let pcm = fixture_pcm()?;
let mut session = AsrSession::connect(settings).await?;
let events = std::mem::replace(&mut session.events, mpsc::channel(1).1);
tokio::spawn(forward_events(app, events, "fixture".into()));
session.push(pcm).await?;
session.finish();
Ok(json!({
"started": true,
"note": "fixture 是 1.6 秒 220Hz 正弦,不是人声。豆包可能返回空或无意义文本,这只证明链路通了。"
}))
}
fn fixture_pcm() -> AppResult<Vec<u8>> {
let path = fixture_path()?;
let bytes = std::fs::read(&path)
.map_err(|e| AppError::new("fixture_missing", format!("{}: {e}", path.display())))?;
// Standard 44-byte PCM WAV header. The fixture is written that way.
if bytes.len() < 44 || &bytes[0..4] != b"RIFF" {
return Err(AppError::new("fixture_invalid", "fixture 不是 WAV"));
}
Ok(bytes[44..].to_vec())
}
fn fixture_path() -> AppResult<std::path::PathBuf> {
let mut candidates = Vec::new();
if let Ok(cwd) = std::env::current_dir() {
candidates.push(cwd.join("fixtures").join("sample.wav"));
if let Some(parent) = cwd.parent() {
candidates.push(parent.join("fixtures").join("sample.wav"));
}
}
if let Ok(exe) = std::env::current_exe() {
if let Some(dir) = exe.parent() {
candidates.push(dir.join("fixtures").join("sample.wav"));
}
}
candidates
.into_iter()
.find(|path| path.is_file())
.ok_or_else(|| AppError::new("fixture_missing", "找不到 fixtures/sample.wav"))
}
#[tauri::command]
pub async fn capture_start(app: AppHandle, state: State<'_, AppState>) -> AppResult<Value> {
if state.capturing.swap(true, Ordering::SeqCst) {
return Err(AppError::new("already_capturing", "已经在采集"));
}
let started = capture_start_inner(app, &state).await;
if started.is_err() {
state.capturing.store(false, Ordering::SeqCst);
}
started
}
async fn capture_start_inner(app: AppHandle, state: &AppState) -> AppResult<Value> {
let settings = settings::load();
settings.validate()?;
let session = AsrSession::connect(settings).await?;
let (stop_tx, stop_rx) = mpsc::channel(1);
*state.stop_capture.lock().await = Some(stop_tx);
let mut session = session;
let events = std::mem::replace(&mut session.events, mpsc::channel(1).1);
let app_for_task = app.clone();
tokio::spawn(async move {
if let Err(err) = capture::capture_to(session, stop_rx).await {
let _ = app_for_task.emit(
"transcript",
json!({ "source": "loopback", "error": err.detail, "text": "", "definite": true }),
);
}
});
let app2 = app.clone();
tokio::spawn(async move {
forward_events(app2, events, "loopback".into()).await;
});
Ok(json!({
"started": true,
"note": capture::platform_note(),
"privacy": "候选人的声音会发到你在设置里填写的豆包服务。开始前需要已告知对方。"
}))
}
#[tauri::command]
pub async fn capture_stop(state: State<'_, AppState>) -> AppResult<Value> {
state.capturing.store(false, Ordering::SeqCst);
if let Some(stop) = state.stop_capture.lock().await.take() {
let _ = stop.send(()).await;
}
Ok(json!({ "stopped": true }))
}
+29
View File
@@ -0,0 +1,29 @@
#![cfg_attr(not(debug_assertions), windows_subsystem = "windows")]
mod capture;
mod commands;
mod settings;
fn main() {
tauri::Builder::default()
.manage(commands::AppState::default())
.invoke_handler(tauri::generate_handler![
commands::app_info,
commands::tmeet_status,
commands::tmeet_login,
commands::tmeet_logout,
commands::meeting_list,
commands::meeting_create,
commands::meeting_get,
commands::meeting_cancel,
commands::meeting_launch,
commands::meeting_people,
commands::speech_get,
commands::speech_save,
commands::speech_test,
commands::capture_start,
commands::capture_stop,
])
.run(tauri::generate_context!())
.expect("腾讯会议测试台启动失败");
}
+91
View File
@@ -0,0 +1,91 @@
use ookie_tx_meeting_core::asr::SpeechSettings;
use ookie_tx_meeting_core::error::{AppError, AppResult};
use serde::Serialize;
pub const KEYRING_SERVICE: &str = "school.oops.ookie.tx-meeting";
const KEYRING_USER: &str = "doubao-asr";
pub fn default_settings() -> SpeechSettings {
SpeechSettings {
auth_mode: "new".into(),
api_key: String::new(),
app_key: String::new(),
access_key: String::new(),
resource_id: "volc.seedasr.sauc.duration".into(),
endpoint: "wss://openspeech.bytedance.com/api/v3/sauc/bigmodel_async".into(),
hotwords: String::new(),
}
}
#[derive(Debug, Clone, Serialize)]
pub struct SpeechSettingsView {
pub auth_mode: String,
pub api_key_set: bool,
pub api_key_hint: String,
pub app_key: String,
pub access_key_set: bool,
pub access_key_hint: String,
pub resource_id: String,
pub endpoint: String,
pub hotwords: String,
}
pub fn view(settings: &SpeechSettings) -> SpeechSettingsView {
SpeechSettingsView {
auth_mode: settings.auth_mode.clone(),
api_key_set: !settings.api_key.is_empty(),
api_key_hint: hint(&settings.api_key),
app_key: settings.app_key.clone(),
access_key_set: !settings.access_key.is_empty(),
access_key_hint: hint(&settings.access_key),
resource_id: settings.resource_id.clone(),
endpoint: settings.endpoint.clone(),
hotwords: settings.hotwords.clone(),
}
}
fn hint(secret: &str) -> String {
let n = secret.chars().count();
if n == 0 {
return String::new();
}
if n <= 4 {
return "••••".into();
}
let tail: String = secret.chars().skip(n - 4).collect();
format!("••••{tail}")
}
pub fn load() -> SpeechSettings {
let Ok(entry) = keyring::Entry::new(KEYRING_SERVICE, KEYRING_USER) else {
return default_settings();
};
match entry.get_password() {
Ok(raw) => serde_json::from_str(&raw).unwrap_or_else(|_| default_settings()),
Err(_) => default_settings(),
}
}
pub fn save(settings: &SpeechSettings) -> AppResult<()> {
settings.validate()?;
let entry = keyring::Entry::new(KEYRING_SERVICE, KEYRING_USER)
.map_err(|e| AppError::new("keyring_failed", e.to_string()))?;
let raw = serde_json::to_string(settings)
.map_err(|e| AppError::new("settings_invalid", e.to_string()))?;
entry
.set_password(&raw)
.map_err(|e| AppError::new("keyring_failed", e.to_string()))?;
Ok(())
}
/// Empty secret fields keep the previously stored secret. Non-secret fields always overwrite.
pub fn merge_secrets(incoming: SpeechSettings, previous: &SpeechSettings) -> SpeechSettings {
let mut next = incoming;
if next.api_key.trim().is_empty() {
next.api_key = previous.api_key.clone();
}
if next.access_key.trim().is_empty() {
next.access_key = previous.access_key.clone();
}
next
}
+30
View File
@@ -0,0 +1,30 @@
{
"$schema": "https://schema.tauri.app/config/2",
"productName": "OOKIE 腾讯会议测试台",
"version": "0.1.0",
"identifier": "school.oops.ookie.tx-meeting",
"build": {
"frontendDist": "../ui"
},
"app": {
"withGlobalTauri": true,
"windows": [
{
"label": "main",
"title": "OOKIE 腾讯会议测试台",
"width": 1180,
"height": 860,
"minWidth": 900,
"minHeight": 640
}
],
"security": {
"csp": "default-src 'self'; script-src 'self'; style-src 'self'; connect-src ipc: http://ipc.localhost"
}
},
"bundle": {
"active": false,
"createUpdaterArtifacts": false,
"icon": ["icons/icon.ico", "icons/icon.png"]
}
}