web-audio-api 0.10.0

A pure Rust implementation of the Web Audio API, for use in non-browser contexts
Documentation
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
use serde::Deserialize;
use std::{error::Error, fs::File, io::BufReader, path::Path};

#[derive(Deserialize, Debug)]
pub struct SnapShot {
    pub data: Vec<f32>,
}

pub fn read<P: AsRef<Path>>(path: P) -> Result<SnapShot, Box<dyn Error>> {
    let file = File::open(path)?;
    let reader = BufReader::new(file);

    let snp = serde_json::from_reader(reader)?;

    Ok(snp)
}