Skip to content

AravDesai/egui_player

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

89 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

A Player for Rust using Egui

Playback files

playback_demo.mp4

Interactive Transcription

transcript_demo

Usage

First, add Player to your App variables. Insert the path to the file to be played in from_path() or bytes using from_bytes()

For file paths:

struct MyApp {
    player: Player,
}

impl Default for MyApp {
    fn default() -> Self {
        Self {
            player: Player::from_path("file_path"),
        }
    }
}

For bytes, enter the following line instead:

player: Player::from_bytes(bytes),

For transcriptions: Set up an async block to allow for asynchronous tokio functions

fn main() {
    let rt = Runtime::new().unwrap();
    let _ = rt.block_on(async {
        eframe::run_native(
            "Player Example",
            NativeOptions::default(),
            Box::new(|_| Ok(Box::new(MyApp::default()))),
        )
    });
}

Now, under the update function, add this line to display the player:

self.player.ui(ui);

For faster transcription, run with the release flag

Examples

To play your own files, clone/download this repository and use: cargo run --example main --release

Supported Audio Formats

Format Playback Transcription
mp3
m4a
wav
flac

Supported Video Formats

Currently working on support

Credits

Dreamweaver.mp3 track in demo assets made by @romms921

About

A player for rust using egui. Currently audio playback and transcription are supported

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages