diff scripts/audio/loadaudio.m @ 11469:c776f063fefe

Overhaul m-script files to use common variable name between code and documentation.
author Rik <octave@nomad.inbox5.com>
date Sun, 09 Jan 2011 12:41:21 -0800
parents be55736a0783
children 1740012184f9
line wrap: on
line diff
--- a/scripts/audio/loadaudio.m
+++ b/scripts/audio/loadaudio.m
@@ -37,7 +37,7 @@
 ## Created: 10 April 1994
 ## Adapted-By: jwe
 
-function X = loadaudio (name, ext, bit)
+function X = loadaudio (name, ext, bps)
 
   if (nargin == 0 || nargin > 3)
     print_usage ();
@@ -48,16 +48,16 @@
   endif
 
   if (nargin < 3)
-    bit = 8;
-  elseif (bit != 8 && bit != 16)
-    error ("loadaudio: bit must be either 8 or 16");
+    bps = 8;
+  elseif (bps != 8 && bps != 16)
+    error ("loadaudio: bps must be either 8 or 16");
   endif
 
   name = [name, ".", ext];
   num = fopen (name, "rb");
 
   if (strcmp (ext, "lin") || strcmp (ext, "raw") || strcmp (ext, "pcm"))
-    if (bit == 8)
+    if (bps == 8)
       [Y, c] = fread (num, inf, "uchar");
       X = Y - 127;
     else
@@ -71,7 +71,7 @@
     if (! isempty (m))
       Y(1:m) = [];
     endif
-    X = mu2lin (Y, bit);
+    X = mu2lin (Y, bps);
   else
     fclose (num);
     error ("loadaudio: unsupported extension");