diff scripts/audio/record.m @ 30571:faf96757915a

record.m, soundsc.m: Small code tweaks for Octave conventions. * record.m: Rename output parameter to match documentation. * soundsc.m: Use default value for function input parameter to simplify code.
author Rik <rik@octave.org>
date Thu, 30 Dec 2021 11:42:19 -0800
parents 82b685157e2b
children 505ed551e366
line wrap: on
line diff
--- a/scripts/audio/record.m	Thu Dec 30 11:28:56 2021 -0800
+++ b/scripts/audio/record.m	Thu Dec 30 11:42:19 2021 -0800
@@ -36,7 +36,7 @@
 ## @seealso{@audiorecorder/audiorecorder, sound, soundsc}
 ## @end deftypefn
 
-function x = record (sec, fs = 8000)
+function data = record (sec, fs = 8000)
 
   if (nargin < 1)
     print_usage ();
@@ -50,16 +50,14 @@
     error ("record: sample rate FS must be a positive number");
   endif
 
-  x = [];
+  data = [];
 
   if (sec > 0)
-
     rec = audiorecorder (fs, 16, 1);
 
     recordblocking (rec, sec);
 
-    x = getaudiodata (rec);
-
+    data = getaudiodata (rec);
   endif
 
 endfunction