diff options
| -rw-r--r-- | c2enc/src/main.rs | 9 |
1 files changed, 4 insertions, 5 deletions
diff --git a/c2enc/src/main.rs b/c2enc/src/main.rs index eb097bd..6099c75 100644 --- a/c2enc/src/main.rs +++ b/c2enc/src/main.rs @@ -22,13 +22,12 @@ fn main() { let mut allbits = Vec::new(); let c = libcodec2::Codec2::new(); let nsam = c.samples_per_frame(); - let nbits = c.bytes_per_frame(); - + let _nbits = c.bytes_per_frame(); + for speech in speech.chunks(nsam) { - let mut bits = Vec::new(); - bits.reserve(nbits); + let mut bits: [u8; 7] = [0,0,0,0,0,0,0]; // nbits assume 7 c.encode(&speech, &mut bits); - allbits.push(bits); + allbits.extend(bits); } println!("{:?}", allbits); |
