fix: 修复服务端推流播放异常的问题
This commit is contained in:
@@ -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!("╔═══════════════════════════════════════════════════════╗");
|
||||
|
||||
@@ -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");
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user