Mercurial > octave-nkf
comparison doc/interpreter/audio.texi @ 2689:8c7955a8d49f
[project @ 1997-02-18 09:06:10 by jwe]
author | jwe |
---|---|
date | Tue, 18 Feb 1997 09:09:12 +0000 |
parents | 18192eea4973 |
children |
comparison
equal
deleted
inserted
replaced
2688:fe5e83216458 | 2689:8c7955a8d49f |
---|---|
28 files holding data in mu-law encoding end in @file{au}, @file{mu}, or | 28 files holding data in mu-law encoding end in @file{au}, @file{mu}, or |
29 @file{snd}. | 29 @file{snd}. |
30 | 30 |
31 @deftypefn {Function File} {} lin2mu (@var{x}) | 31 @deftypefn {Function File} {} lin2mu (@var{x}) |
32 If the vector @var{x} represents mono audio data in 8- or 16-bit | 32 If the vector @var{x} represents mono audio data in 8- or 16-bit |
33 linear encoding, @code{lin2mu (@var{x})} is the correspoding mu-law | 33 linear encoding, @code{lin2mu (@var{x})} is the corresponding mu-law |
34 encoding. | 34 encoding. |
35 @end deftypefn | 35 @end deftypefn |
36 | 36 |
37 @deftypefn {Function File} {} mu2lin (@var{x}, @var{bps}) | 37 @deftypefn {Function File} {} mu2lin (@var{x}, @var{bps}) |
38 If the vector @var{x} represents mono audio data in mu-law encoding, | 38 If the vector @var{x} represents mono audio data in mu-law encoding, |
39 @code{mu2lin (@var{x} [, @var{bps}])} converts it to linear encoding. | 39 @code{mu2lin} converts it to linear encoding. The optional argument |
40 The optional argument @var{bps} specifies whether the input data uses | 40 @var{bps} specifies whether the input data uses 8 bit per sample |
41 8 bit per sample (default) or 16 bit. | 41 (default) or 16 bit. |
42 @end deftypefn | 42 @end deftypefn |
43 | |
44 @c XXX FIXME XXX -- ext and bps are optional, but we need to note the | |
45 @c default values here too. | |
46 | 43 |
47 @deftypefn {Function File} {} loadaudio (@var{name}, @var{ext}, @var{bps}) | 44 @deftypefn {Function File} {} loadaudio (@var{name}, @var{ext}, @var{bps}) |
48 Loads audio data from the file @file{@var{name}.@var{ext}} into the | 45 Loads audio data from the file @file{@var{name}.@var{ext}} into the |
49 vector @var{x}. | 46 vector @var{x}. |
50 | 47 |
67 | 64 |
68 The following functions for audio I/O require special A/D hardware and | 65 The following functions for audio I/O require special A/D hardware and |
69 operating system support. It is assumed that audio data in linear | 66 operating system support. It is assumed that audio data in linear |
70 encoding can be played and recorded by reading from and writing to | 67 encoding can be played and recorded by reading from and writing to |
71 @file{/dev/dsp}, and that similarly @file{/dev/audio} is used for mu-law | 68 @file{/dev/dsp}, and that similarly @file{/dev/audio} is used for mu-law |
72 encoding. This definitely works on Linux systems, and should also work | 69 encoding. These file names are system-dependent. Improvements so that |
73 on Suns. If your hardware is accessed differently, please contact | 70 these functions will work without modification on a wide variety of |
74 Andreas Weingessel <Andreas.Weingessel@@ci.tuwien.ac.at>. | 71 hardware are welcome. |
75 | 72 |
76 @deftypefn {Function File} {} playaudio (@var{name}, @var{ext}) | 73 @deftypefn {Function File} {} playaudio (@var{name}, @var{ext}) |
77 @deftypefnx {Function File} {} playaudio (@var{x}) | 74 @deftypefnx {Function File} {} playaudio (@var{x}) |
78 Plays the audio file @file{@var{name}.@var{ext}} or in the vector | 75 Plays the audio file @file{@var{name}.@var{ext}} or the audio data |
79 @var{x}. | 76 stored in the vector @var{x}. |
80 @end deftypefn | 77 @end deftypefn |
81 | 78 |
82 @deftypefn {Function File} {} record (@var{sec}, @var{sampling_rate}) | 79 @deftypefn {Function File} {} record (@var{sec}, @var{sampling_rate}) |
83 Records @var{sec} seconds of audio input into the vector @var{x}. The | 80 Records @var{sec} seconds of audio input into the vector @var{x}. The |
84 default value for @var{sampling_rate} is 8000 samples per second, or | 81 default value for @var{sampling_rate} is 8000 samples per second, or |
85 8kHz. The program waits until the user types @kbd{RET} and then | 82 8kHz. The program waits until the user types @key{RET} and then |
86 immediately starts to record. | 83 immediately starts to record. |
87 @end deftypefn | 84 @end deftypefn |
88 | 85 |
89 @deftypefn {Function File} {} setaudio (@var{type}) | 86 @deftypefn {Function File} {} setaudio (@var{type}) |
90 @deftypefnx {Function File} {} setaudio (@var{type}, @var{value}) | 87 @deftypefnx {Function File} {} setaudio (@var{type}, @var{value}) |