Skip to main content

Crate bevy_whisperer

Crate bevy_whisperer 

Source
Expand description

Speech recognition plugin for bevy, using whisper-apr.

§Getting started

You will need an .apr model to use the plugin. Download the whisper-tiny model here and save it to your assets folder.

§Usage

use bevy::prelude::*;
use bevy_whisperer::prelude::*;

fn main() {
    App::new()
        .add_plugins(DefaultPlugins)
        .add_plugins(WhispererPlugin)
        .add_systems(Startup, setup)
        .run();
}

fn setup(
    mut commands: Commands,
    asset_server: Res<AssetServer>,
) {
    // Load the apr model
    commands.spawn((
        WhisperAprModel(asset_server.load("whisper-tiny.apr")),
        DefaultWhisper
    ));
}

See the examples for more.

Modules§

prelude

Structs§

DefaultWhisper
A component to tag an entity as the default whisper model
SpeechRecognition
Speech recognition component Add this component to an entity to transcribe speech from a microphone
TranscribeFailure
Entity event triggered when there’s a transcription error
TranscribeSuccess
Entity event triggered when speech was successfully transcribed
TranscriptionTaskResult
Result of a transcription task
Whisper
Wrapper component for WhisperApr
WhisperAprModel
AprModel Handle
WhispererPlugin
Whisperer plugin