comparison scripts/audio/@audioplayer/audioplayer.m @ 19540:fdb8a62ef17a

fix docstring style in .m files * @audioplayer/__get_properties__.m, @audioplayer/audioplayer.m, @audioplayer/get.m, @audioplayer/isplaying.m, @audioplayer/pause.m, @audioplayer/play.m, @audioplayer/playblocking.m, @audioplayer/resume.m, @audioplayer/set.m, @audioplayer/stop.m, @audiorecorder/audiorecorder.m,@audiorecorder/get.m, @audiorecorder/getaudiodata.m, @audiorecorder/getplayer.m, @audiorecorder/isrecording.m, @audiorecorder/pause.m, @audiorecorder/play.m, @audiorecorder/record.m, @audiorecorder/recordblocking.m, @audiorecorder/resume.m, @audiorecorder/set.m, @audiorecorder/stop.m: Fix docstring style.
author John W. Eaton <jwe@octave.org>
date Wed, 31 Dec 2014 13:45:45 -0500
parents ce02743b6f2a
children dac3191a5301
comparison
equal deleted inserted replaced
19539:ce02743b6f2a 19540:fdb8a62ef17a
16 ## along with Octave; see the file COPYING. If not, see 16 ## along with Octave; see the file COPYING. If not, see
17 ## <http://www.gnu.org/licenses/>. 17 ## <http://www.gnu.org/licenses/>.
18 18
19 ## -*- texinfo -*- 19 ## -*- texinfo -*-
20 ## @deftypefn {Function File} {@var{player} =} audioplayer (@var{y}, @var{fs}) 20 ## @deftypefn {Function File} {@var{player} =} audioplayer (@var{y}, @var{fs})
21 ## @deftypefnx {Function File} {@var{player} =} audioplayer (@var{y}, @var{fs}, @var{nbits})
22 ## @deftypefnx {Function File} {@var{player} =} audioplayer (@var{y}, @var{fs}, @var{nbits}, @var{id})
23 ## @deftypefnx {Function File} {@var{player} =} audioplayer (@var{function}, @dots{})
24 ## @deftypefnx {Function File} {@var{player} =} audioplayer (@var{recorder})
25 ## @deftypefnx {Function File} {@var{player} =} audioplayer (@var{recorder}, @var{id})
21 ## Create an audioplayer object that will play back data @var{y} at sample 26 ## Create an audioplayer object that will play back data @var{y} at sample
22 ## rate @var{fs}. 27 ## rate @var{fs}. The optional arguments @var{nbits}, and @var{id}
23 ## @end deftypefn 28 ## specify the bit depth and player device id, respectively. Device IDs
24 ## @deftypefn {Function File} {@var{player} =} audioplayer (@var{y}, @var{fs}, @var{nbits}) 29 ## may be found using the audiodevinfo function.
25 ## Create an audioplayer object that will play back data @var{y} at sample 30 ## Given a function handle, use that function to process the audio.
26 ## rate @var{fs} and bit depth @var{nbits}. 31 ## Given an audioplayer object, use the data from the object to
27 ## @end deftypefn 32 ## initialize the player.
28 ## @deftypefn {Function File} {@var{player} =} audioplayer (@var{y}, @var{fs}, @var{nbits}, @var{id})
29 ## Create an audioplayer object that will play back data @var{y} at sample
30 ## rate @var{fs}, bit depth @var{nbits} and using a device with @var{id}
31 ## that you can get using the audiodevinfo function.
32 ## @end deftypefn
33 ## @deftypefn {Function File} {@var{player} =} audioplayer (@var{function}, @var{fs})
34 ## Argument @var{function} is a function handle, inline function or a string
35 ## value of a function name that will get called to process audio. Audio
36 ## will be played at @var{fs} sampling rate.
37 ## @end deftypefn
38 ## @deftypefn {Function File} {@var{player} =} audioplayer (@var{function}, @var{fs}, @var{nbits})
39 ## Same as above but also allows you to specify the number of bits per
40 ## sample.
41 ## @end deftypefn
42 ## @deftypefn {Function File} {@var{player} =} audioplayer (@var{function}, @var{fs}, @var{nbits}, @var{id})
43 ## Same as above but also allows you to specify device @var{id} that will be
44 ## used.
45 ## @end deftypefn
46 ## @deftypefn {Function File} {@var{player} =} audioplayer (@var{recorder})
47 ## Create an audioplayer object that will use data and other information
48 ## such as sample rate from an audiorecorder object.
49 ## @end deftypefn
50 ## @deftypefn {Function File} {@var{player} =} audioplayer (@var{recorder}, @var{id})
51 ## Create an audioplayer object that will use data and other information
52 ## from an audiorecorder object and that will use a device with the given @var{id}.
53 ## @end deftypefn 33 ## @end deftypefn
54 ## 34 ##
55 ## The signal @var{y} can be a vector or a two dimensional array. 35 ## The signal @var{y} can be a vector or a two dimensional array.
56 ## 36 ##
57 ## The following example will create an audioplayer object that will play 37 ## The following example will create an audioplayer object that will play
58 ## back one second of white noise at 44100 sample rate using 8 bits per 38 ## back one second of white noise at 44100 sample rate using 8 bits per
59 ## sample. 39 ## sample.
60 ## 40 ##
61 ## @example 41 ## @example
62 ## @group 42 ## @group
63 ## @code{y = randn (2, 44100) - 0.5;} 43 ## y = randn (2, 44100) - 0.5;
64 ## @code{player = audioplayer (y, 44100, 8);} 44 ## player = audioplayer (y, 44100, 8);
65 ## @code{play (player);} 45 ## play (player);
66 ## @end group 46 ## @end group
67 ## @end example 47 ## @end example
68 ## 48 ##
69 ## The following example will create and register a callback that generates 49 ## The following example will create and register a callback that generates
70 ## a sine wave on both channels. 50 ## a sine wave on both channels.
71 ## 51 ##
72 ## @example 52 ## @example
73 ## @group 53 ## @group
74 ## @code{function [ sound, status ] = callback_sine (frames)} 54 ## function [ sound, status ] = callback_sine (frames)
75 ## @code{ global lphase = 0.0;} 55 ## global lphase = 0.0;
76 ## @code{ global rphase = 0.0;} 56 ## global rphase = 0.0;
77 ## @code{ incl = 440.0 / 44100.0;} 57 ## incl = 440.0 / 44100.0;
78 ## @code{ incr = 443.0 / 44100.0;} 58 ## incr = 443.0 / 44100.0;
79 ## @code{ nl = incl * frames;} 59 ## nl = incl * frames;
80 ## @code{ nr = incr * frames;} 60 ## nr = incr * frames;
81 ## @code{ left = sin (2.0 * pi * [lphase:incl:lphase+nl]);} 61 ## left = sin (2.0 * pi * [lphase:incl:lphase+nl]);
82 ## @code{ right = sin (2.0 * pi * [rphase:incr:rphase+nr]);} 62 ## right = sin (2.0 * pi * [rphase:incr:rphase+nr]);
83 ## @code{ sound = [left', right'];} 63 ## sound = [left', right'];
84 ## @code{ status = 0;} 64 ## status = 0;
85 ## @code{ lphase = lphase + nl;} 65 ## lphase = lphase + nl;
86 ## @code{ rphase = rphase + nr;} 66 ## rphase = rphase + nr;
87 ## @code{endfunction} 67 ## endfunction
88 ## @code{player = audioplayer (@@callback_sine, 44100);} 68 ## player = audioplayer (@@callback_sine, 44100);
89 ## @code{play (player);} 69 ## play (player);
90 ## @code{# play for as long as you want} 70 ## # play for as long as you want
91 ## @code{stop (player);} 71 ## stop (player);
92 ## @end group 72 ## @end group
93 ## @end example 73 ## @end example
94 74
95 function player = audioplayer (varargin) 75 function player = audioplayer (varargin)
96 if (nargin < 1 || nargin > 4) 76 if (nargin < 1 || nargin > 4)