chore: 拆分 bin 入口
This commit is contained in:
@@ -0,0 +1 @@
|
|||||||
|
*.mp3
|
||||||
@@ -15,3 +15,10 @@ debug = false
|
|||||||
alsa = "0.11"
|
alsa = "0.11"
|
||||||
opus = "0.3"
|
opus = "0.3"
|
||||||
anyhow = "1.0"
|
anyhow = "1.0"
|
||||||
|
tokio = { version = "1.47", features = ["full"] }
|
||||||
|
symphonia = { version = "0.5", features = ["mp3", "isomp4"] }
|
||||||
|
serde = { version = "1.0", features = ["derive"] }
|
||||||
|
bincode = "1.3"
|
||||||
|
log = "0.4"
|
||||||
|
env_logger = "0.11"
|
||||||
|
byteorder = "1.5"
|
||||||
|
|||||||
@@ -0,0 +1,12 @@
|
|||||||
|
use hello::audio::{AudioPlayer, OpusCodec};
|
||||||
|
use hello::config::AudioConfig;
|
||||||
|
use anyhow::Result;
|
||||||
|
|
||||||
|
// todo 左右声道分发,播放音频
|
||||||
|
fn main() -> Result<()> {
|
||||||
|
let config = AudioConfig::default();
|
||||||
|
let player = AudioPlayer::new(&config)?;
|
||||||
|
let mut codec = OpusCodec::new(&config)?;
|
||||||
|
|
||||||
|
|
||||||
|
}
|
||||||
@@ -0,0 +1,11 @@
|
|||||||
|
use hello::audio::{OpusCodec};
|
||||||
|
use hello::config::AudioConfig;
|
||||||
|
use anyhow::Result;
|
||||||
|
|
||||||
|
// todo 向 client 分发左右声道音频数据
|
||||||
|
fn main() -> Result<()> {
|
||||||
|
let config = AudioConfig::default();
|
||||||
|
let mut codec = OpusCodec::new(&config)?;
|
||||||
|
|
||||||
|
|
||||||
|
}
|
||||||
@@ -1,8 +1,5 @@
|
|||||||
mod audio;
|
use hello::audio::{AudioPlayer, AudioRecorder, OpusCodec};
|
||||||
mod config;
|
use hello::config::AudioConfig;
|
||||||
|
|
||||||
use crate::audio::{AudioPlayer, AudioRecorder, OpusCodec};
|
|
||||||
use crate::config::AudioConfig;
|
|
||||||
use anyhow::Result;
|
use anyhow::Result;
|
||||||
use std::collections::VecDeque;
|
use std::collections::VecDeque;
|
||||||
use std::time::{Duration, Instant};
|
use std::time::{Duration, Instant};
|
||||||
@@ -0,0 +1,4 @@
|
|||||||
|
pub mod audio;
|
||||||
|
pub mod config;
|
||||||
|
pub mod net;
|
||||||
|
pub mod sync;
|
||||||
@@ -0,0 +1,6 @@
|
|||||||
|
pub mod protocol;
|
||||||
|
pub mod discovery;
|
||||||
|
|
||||||
|
pub use protocol::*;
|
||||||
|
pub use discovery::*;
|
||||||
|
|
||||||
@@ -27,4 +27,7 @@ docker run --rm -v $(pwd)/../hello:/app/hello open-xiaoai-runtime \
|
|||||||
|
|
||||||
# 5. 上传二进制文件到小爱音箱
|
# 5. 上传二进制文件到小爱音箱
|
||||||
# dd if=apps/hello/target/armv7-unknown-linux-gnueabihf/release/hello \
|
# dd if=apps/hello/target/armv7-unknown-linux-gnueabihf/release/hello \
|
||||||
# | ssh -o HostKeyAlgorithms=+ssh-rsa root@192.168.31.235 "dd of=/data/hello"
|
# | ssh -o HostKeyAlgorithms=+ssh-rsa root@192.168.31.235 "dd of=/data/hello"
|
||||||
|
|
||||||
|
# dd if=apps/hello/target/armv7-unknown-linux-gnueabihf/release/hello \
|
||||||
|
# | ssh -o HostKeyAlgorithms=+ssh-rsa root@192.168.31.153 "dd of=/data/hello"
|
||||||
Reference in New Issue
Block a user