diff --git a/Cargo.toml b/Cargo.toml index 9428745..4bc5b05 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -2,6 +2,8 @@ name = "rodio-xm" version = "0.1.0" edition = "2018" +repository = "https://tinybird.dev/max/rodio-xm" +authors = ["Max Bradbury"] # See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html diff --git a/src/lib.rs b/src/lib.rs index 46b21f4..28562da 100644 --- a/src/lib.rs +++ b/src/lib.rs @@ -1,13 +1,14 @@ +use std::fs; use std::path::PathBuf; use std::time::Duration; use libxm::*; -use rodio::{OutputStream, Source, Sink}; -use std::fs; +use rodio::Source; pub const BUFFER_SIZE: usize = 2048; /// Example usage +/// /// ```rust /// fn main() { /// let mut xm = libxm::XMContext::new( @@ -46,15 +47,15 @@ impl XMSource { let xm = libxm::XMContext::new(bytes, 48000) .expect("failed to parse xm"); - self::new(xm) + XMSource::new(xm) } pub fn from_file(path: PathBuf) -> Self { let file = fs::read(path).expect("couldn't read file"); - let xm = libxm::XMContext::new(file.as_bytes(), 48000) + let xm = libxm::XMContext::new(&file, 48000) .expect("failed to parse xm"); - self::new(xm) + XMSource::new(xm) } }