midibase 0.3.0

send commands to obs-websocket using midi hardware
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
use rodio::Source;
use std::fs::File;
use std::io::BufReader;


pub struct Soundboard {}

impl Soundboard {
    pub fn play_sound(file : &str){
        println!("Playing Sound \"{}\"", file);
        let device = rodio::default_output_device().unwrap();
        
        let file = File::open(file).unwrap();
        let source = rodio::Decoder::new(BufReader::new(file)).unwrap();
        rodio::play_raw(&device, source.convert_samples());
    }
}