pub struct Wav { /* private fields */ }
Implementations§
Source§impl Wav
impl Wav
Sourcepub fn new(path: &str) -> Self
pub fn new(path: &str) -> Self
Get the final Url
of this Response
.
§Example
fn main() {
// Support for local and network files.
// let mut wav = Wav::new("http://[host]/sample-15s.wav").set_json_width(1920);
let mut wav = Wav::new("examples/sample-15s.wav").set_json_width(1920);
println!("duration: {}", Instant::now().elapsed().as_millis());
// Generate json data files that can be rendered.
let mut json_file = File::create("examples/data.json").expect("create failed");
json_file.write(b"[").unwrap();
for v in result_data.iter() {
json_file.write(v.to_string().as_bytes()).unwrap();
json_file.write(b",").unwrap();
}
json_file.write(b"]").unwrap();
}
Sourcepub fn set_json_width(self, width: u32) -> Self
pub fn set_json_width(self, width: u32) -> Self
Sets the number of json points generated by decoding.
Trait Implementations§
Auto Trait Implementations§
impl Freeze for Wav
impl !RefUnwindSafe for Wav
impl Send for Wav
impl Sync for Wav
impl Unpin for Wav
impl !UnwindSafe for Wav
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more