comparison scripts/audio/loadaudio.m @ 2325:b5568c31ee2c

[project @ 1996-07-15 22:20:21 by jwe]
author jwe
date Mon, 15 Jul 1996 22:20:21 +0000
parents 5ca126254d15
children 7ffb2a630708
comparison
equal deleted inserted replaced
2324:fdc6e2f81333 2325:b5568c31ee2c
17 ## Software Foundation, 59 Temple Place - Suite 330, Boston, MA 17 ## Software Foundation, 59 Temple Place - Suite 330, Boston, MA
18 ## 02111-1307, USA. 18 ## 02111-1307, USA.
19 19
20 ## usage: X = loadaudio (name [, ext [, bit]]) 20 ## usage: X = loadaudio (name [, ext [, bit]])
21 ## 21 ##
22 ## Loads audio data from the file "name.ext" into the data vector X. 22 ## Loads audio data from the file "name.ext" into the data vector X.
23 ## Default value for the "ext" argument, which has to be written 23 ## Default value for the "ext" argument, which has to be written
24 ## without the initial ".", is "lin". 24 ## without the initial ".", is "lin".
25 ## Currently, the following audio formats are supported: 25 ## Currently, the following audio formats are supported:
26 ## *) mu-law encoding with extension "mu", "au" or "snd" 26 ## *) mu-law encoding with extension "mu", "au" or "snd"
27 ## *) linear encoding with extension "lin" or "raw" 27 ## *) linear encoding with extension "lin" or "raw"
28 ## 28 ##
29 ## The `bit' argument can be either 8 (default) or 16. 29 ## The `bit' argument can be either 8 (default) or 16.
30 ## Depending on the value of bit, linearly encoded files are 30 ## Depending on the value of bit, linearly encoded files are
31 ## interpreted as being in 8 and 16 bit format, respectively, and 31 ## interpreted as being in 8 and 16 bit format, respectively, and
32 ## mu-law encoded files are transformed to 8 and 16-bit linear 32 ## mu-law encoded files are transformed to 8 and 16-bit linear
33 ## format, respectively. 33 ## format, respectively.
35 ## Author: AW <Andreas.Weingessel@ci.tuwien.ac.at> 35 ## Author: AW <Andreas.Weingessel@ci.tuwien.ac.at>
36 ## Created: 10 April 1994 36 ## Created: 10 April 1994
37 ## Adapted-By: jwe 37 ## Adapted-By: jwe
38 38
39 function X = loadaudio (name, ext, bit) 39 function X = loadaudio (name, ext, bit)
40 40
41 if (nargin == 0 || nargin > 3) 41 if (nargin == 0 || nargin > 3)
42 usage ("loadaudio (name [, ext [, bit]])"); 42 usage ("loadaudio (name [, ext [, bit]])");
43 endif 43 endif
44 44
45 if (nargin == 1) 45 if (nargin == 1)
74 fclose (num); 74 fclose (num);
75 error ("loadaudio does not support given extension"); 75 error ("loadaudio does not support given extension");
76 endif 76 endif
77 77
78 fclose (num); 78 fclose (num);
79 79
80 endfunction 80 endfunction
81 81
82 82
83 83