removed itertools
This commit is contained in:
parent
892024f5d8
commit
9a084347db
|
@ -11,7 +11,6 @@ keywords = ["audio", "sound"]
|
||||||
[dependencies]
|
[dependencies]
|
||||||
failure = "0.1.5"
|
failure = "0.1.5"
|
||||||
lazy_static = "1.3"
|
lazy_static = "1.3"
|
||||||
itertools = "0.7.8"
|
|
||||||
|
|
||||||
[dev-dependencies]
|
[dev-dependencies]
|
||||||
hound = "3.4"
|
hound = "3.4"
|
||||||
|
|
|
@ -1,5 +1,4 @@
|
||||||
extern crate asio_sys as sys;
|
extern crate asio_sys as sys;
|
||||||
extern crate itertools;
|
|
||||||
|
|
||||||
use std;
|
use std;
|
||||||
use Format;
|
use Format;
|
||||||
|
@ -12,7 +11,6 @@ use UnknownTypeOutputBuffer;
|
||||||
use UnknownTypeInputBuffer;
|
use UnknownTypeInputBuffer;
|
||||||
use std::sync::{Arc, Mutex};
|
use std::sync::{Arc, Mutex};
|
||||||
use std::mem;
|
use std::mem;
|
||||||
use self::itertools::Itertools;
|
|
||||||
use std::sync::atomic::{AtomicUsize, Ordering};
|
use std::sync::atomic::{AtomicUsize, Ordering};
|
||||||
|
|
||||||
pub struct EventLoop {
|
pub struct EventLoop {
|
||||||
|
@ -218,11 +216,13 @@ pub fn build_output_stream(
|
||||||
// cpal writes to buffer interleaved
|
// cpal writes to buffer interleaved
|
||||||
fn deinterleave(data_slice: &mut [$SampleType],
|
fn deinterleave(data_slice: &mut [$SampleType],
|
||||||
num_channels: usize) -> Vec<Vec<$SampleType>>{
|
num_channels: usize) -> Vec<Vec<$SampleType>>{
|
||||||
let mut channels: Vec<Vec<$SampleType>> = Vec::new();
|
let channel_len = data_slice.len() / num_channels;
|
||||||
for i in 0..num_channels{
|
let mut channels: Vec<_> = (0..num_channels)
|
||||||
let mut it = data_slice.iter().skip(i).cloned();
|
.map(|_| Vec::with_capacity(channel_len))
|
||||||
let channel = it.step(num_channels).collect();
|
.collect();
|
||||||
channels.push(channel);
|
for (i, &sample) in data_slice.iter().enumerate() {
|
||||||
|
let ch = i % num_channels;
|
||||||
|
channels[ch].push(sample);
|
||||||
}
|
}
|
||||||
channels
|
channels
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue