From 6266d8a74d5bb664d788e973abb013006e11ec95 Mon Sep 17 00:00:00 2001 From: bunnie Date: Mon, 2 Jan 2023 14:49:32 +0800 Subject: [PATCH] add panic if recbuf is not allocated should never happen, but, might as well dot the i's. --- services/shellchat/src/cmds/test.rs | 2 ++ 1 file changed, 2 insertions(+) diff --git a/services/shellchat/src/cmds/test.rs b/services/shellchat/src/cmds/test.rs index 077ca3a2b..6539d8d88 100644 --- a/services/shellchat/src/cmds/test.rs +++ b/services/shellchat/src/cmds/test.rs @@ -405,6 +405,8 @@ impl<'a> ShellCmdApi<'a> for Test { right_samples.push( ((sample & 0xFFFF) as i16) as f32 ); //left_samples.push( (((sample >> 16) & 0xFFFF) as i16) as f32 ); // reminder of how to extract the right channel } + } else { + panic!("recbuf was not allocated"); } // only one channel is considered, because in reality the left is just a copy of the right, as // we are taking a mono microphone signal and mixing it into both ADCs