web-audio-api 0.14.0

A pure Rust implementation of the Web Audio API, for use in non-browser contexts
Documentation
use std::error::Error;
use std::fs::File;
use std::io::{BufRead, BufReader};
use std::path::Path;

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 data = reader
        .lines()
        .map(|l| l.unwrap().parse::<f32>().unwrap())
        .collect();

    Ok(SnapShot { data })
}