3294
|
1 @c Copyright (C) 1996, 1997 John W. Eaton |
5428
|
2 @c Written by Kurt Hornik <Kurt.Hornik@wu-wien.ac.at> on 1996/05/14 |
3294
|
3 @c This is part of the Octave manual. |
|
4 @c For copying conditions, see the file gpl.texi. |
|
5 |
4167
|
6 @node Audio Processing |
3294
|
7 @chapter Audio Processing |
|
8 |
|
9 Octave provides a few functions for dealing with audio data. An audio |
|
10 `sample' is a single output value from an A/D converter, i.e., a small |
|
11 integer number (usually 8 or 16 bits), and audio data is just a series |
|
12 of such samples. It can be characterized by three parameters: the |
|
13 sampling rate (measured in samples per second or Hz, e.g. 8000 or |
|
14 44100), the number of bits per sample (e.g. 8 or 16), and the number of |
|
15 channels (1 for mono, 2 for stereo, etc.). |
|
16 |
|
17 There are many different formats for representing such data. Currently, |
|
18 only the two most popular, @emph{linear encoding} and @emph{mu-law |
|
19 encoding}, are supported by Octave. There is an excellent FAQ on audio |
|
20 formats by Guido van Rossum <guido@@cwi.nl> which can be found at any |
|
21 FAQ ftp site, in particular in the directory |
|
22 @file{/pub/usenet/news.answers/audio-fmts} of the archive site |
|
23 @code{rtfm.mit.edu}. |
|
24 |
|
25 Octave simply treats audio data as vectors of samples (non-mono data are |
|
26 not supported yet). It is assumed that audio files using linear |
|
27 encoding have one of the extensions @file{lin} or @file{raw}, and that |
|
28 files holding data in mu-law encoding end in @file{au}, @file{mu}, or |
|
29 @file{snd}. |
|
30 |
3332
|
31 @DOCSTRING(lin2mu) |
3294
|
32 |
3332
|
33 @DOCSTRING(mu2lin) |
3294
|
34 |
3332
|
35 @DOCSTRING(loadaudio) |
3294
|
36 |
3332
|
37 @DOCSTRING(saveaudio) |
3294
|
38 |
|
39 The following functions for audio I/O require special A/D hardware and |
|
40 operating system support. It is assumed that audio data in linear |
|
41 encoding can be played and recorded by reading from and writing to |
|
42 @file{/dev/dsp}, and that similarly @file{/dev/audio} is used for mu-law |
|
43 encoding. These file names are system-dependent. Improvements so that |
|
44 these functions will work without modification on a wide variety of |
|
45 hardware are welcome. |
|
46 |
3332
|
47 @DOCSTRING(playaudio) |
3294
|
48 |
3332
|
49 @DOCSTRING(record) |
3294
|
50 |
3332
|
51 @DOCSTRING(setaudio) |
|
52 |