Open esn01 opened 8 years ago
If anyone is wondering why take is returning an Ok([])
that is why. you can "fix" it by doing something like:
let mut res = cap.take();
match res {
Ok(mut v) => {
unsafe {v.set_len(num_samples); }
println!("{:?}", v);
},
Err(_) => {
println!("couldn't get samples");
}
}
alcCaptureSamples fills the memory of the result structure (Vec) only. Capture.take() needs to call result.set_len(self.len()) after call to alcCaptureSamples().