yo-esp 0.1.1

ESP32-client for the yo voice assistant framework (no_std + alloc)
docs.rs failed to build yo-esp-0.1.1
Please check the build logs for more information.
See Builds for ideas on how to fix a failed build, or Metadata for how to configure docs.rs builds.
If you believe this is docs.rs' fault, open an issue.

yo-esp

Sponsors Buy Me a Coffee

yo-esp is a esp32 audio streaming client for the voice assistant yo and is designed for bare metal and no_std projects.

Installation

Add yo-esp as a dependency in Cargo.toml.

[dependencies]
yo-esp = "0.1.0"

Example usage

use yo_esp::{
    microphone::Microphone,
    run_audio_stream,
    AudioStreamConfig,
    CommandHandler,
};

struct MyHandler;
impl CommandHandler for MyHandler {
    fn on_wake_word_detected(&mut self) {
        info!("Wake word detected!");
    }
    fn on_command_executed(&mut self) {
        info!("Command executed");
    }
    fn on_command_failed(&mut self) {
        info!("Command failed");
    }
}

#[embassy_executor::task]
async fn audio_task(
    mic: Microphone,
    handler: MyHandler,
    stack: &'static embassy_net::Stack<'static>,
    addr: SocketAddr,
    config: AudioStreamConfig,
) {
    run_audio_stream(mic, handler, stack, addr, config).await;
}

// in main() after i2s init:
        let mic = Microphone::new(i2s_rx);
        let handler = MyHandler;
        let config = AudioStreamConfig {
            room: "esp", // leave as `esp`
            ..Default::default()
        };
        spawner.spawn(audio_task(mic, handler, stack, remote_addr, config)).unwrap();

Sponsors Buy Me a Coffee

🦆🧑‍🦯 says ⮞ Hi! I'm QuackHack-McBlindy!
Like my work?
Buy me a coffee, or become a sponsor.
Thanks for supporting open source/hungry developers ♥️🦆!

♥️₿ Wallet: pungkula.x

License

MIT
Contributions are welcomed.