diff options
| author | Yuval Adam <_@yuv.al> | 2022-07-23 12:21:21 +0300 |
|---|---|---|
| committer | Yuval Adam <_@yuv.al> | 2022-07-23 12:21:21 +0300 |
| commit | 348dce1f556318ec96bf4de02795628c7a5eb829 (patch) | |
| tree | bd73896783909a5779856211527ccd78fa52414d /c2enc/src | |
| parent | efce6b6218d589094fee9aa42c3400c4af622edb (diff) | |
Fix dynamic buffer alloc
Diffstat (limited to 'c2enc/src')
| -rw-r--r-- | c2enc/src/main.rs | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/c2enc/src/main.rs b/c2enc/src/main.rs index e0181f3..b20f133 100644 --- a/c2enc/src/main.rs +++ b/c2enc/src/main.rs @@ -35,10 +35,10 @@ 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 samples in speech.chunks(nsam) { - let mut bits: [u8; 7] = [0, 0, 0, 0, 0, 0, 0]; // nbits assume 7 + let mut bits = vec![0u8; nbits]; c.encode(&samples, &mut bits); allbits.extend(bits); } |
