Mercurial > hg > octave-lyh
diff scripts/audio/loadaudio.m @ 3167:d609b993be3b
[project @ 1998-04-17 04:41:59 by jwe]
author | jwe |
---|---|
date | Fri, 17 Apr 1998 04:42:03 +0000 |
parents | 8b262e771614 |
children | 7c03933635c6 |
line wrap: on
line diff
--- a/scripts/audio/loadaudio.m +++ b/scripts/audio/loadaudio.m @@ -23,8 +23,8 @@ ## Default value for the "ext" argument, which has to be written ## without the initial ".", is "lin". ## Currently, the following audio formats are supported: -## *) mu-law encoding with extension "mu", "au" or "snd" -## *) linear encoding with extension "lin" or "raw" +## *) mu-law encoding with extension "mu", "au", or "snd" +## *) linear encoding with extension "lin", "pcm", or "raw" ## ## The `bit' argument can be either 8 (default) or 16. ## Depending on the value of bit, linearly encoded files are @@ -53,9 +53,9 @@ endif name = [name, ".", ext]; - num = fopen (name, "r"); + num = fopen (name, "rb"); - if (strcmp (ext, "lin") || strcmp (ext, "raw")) + if (strcmp (ext, "lin") || strcmp (ext, "raw") || strcmp (ext, "pcm")) if (bit == 8) [Y, c] = fread (num, inf, "uchar"); X = Y - 127;