fix: 修复服务端推流播放异常的问题

This commit is contained in:
Del Wang
2026-01-05 20:13:25 +08:00
parent d88d63b15b
commit c0bc4b8ae6
22 changed files with 870 additions and 191 deletions
-10
View File
@@ -6,21 +6,11 @@
//! - 音频录制和播放
//! - 事件处理
#[cfg(target_os = "linux")]
use std::sync::Arc;
#[cfg(target_os = "linux")]
use xiao::app::client::{Client, ClientConfig};
#[cfg(target_os = "linux")]
use xiao::net::command::Command;
#[cfg(target_os = "linux")]
use xiao::net::event::NotificationLevel;
#[cfg(not(target_os = "linux"))]
fn main() {
println!("This client only works on Linux due to ALSA dependencies.");
}
#[cfg(target_os = "linux")]
#[tokio::main]
async fn main() -> anyhow::Result<()> {
println!("╔═══════════════════════════════════════════════════════╗");
+1 -1
View File
@@ -109,7 +109,7 @@ async fn main() -> anyhow::Result<()> {
match server.start_play(addr, "temp/test.wav").await {
Ok(_) => {
println!(" ▶️ Playback started...");
tokio::time::sleep(std::time::Duration::from_secs(5)).await;
tokio::time::sleep(std::time::Duration::from_secs(60)).await;
server.stop_play(addr).await?;
println!(" ⏹️ Playback stopped");
}