Mercurial > hg > octave-nkf
view scripts/audio/record.m @ 19878:0f557da98f5b
record.m: Overhaul function.
* record.m: Rewrite as a simple wrapper around audiorecorder. Rewrite
docstring. Add seealso link to audiorecorder. Add %!assert (1) to mark
function as not needing tests.
author | Mike Miller <mtmiller@ieee.org> |
---|---|
date | Sun, 08 Feb 2015 01:09:32 -0500 |
parents | 0165d9607624 |
children | 890ff06d84ce |
line wrap: on
line source
## Copyright (C) 2015 Mike Miller ## Copyright (C) 1995-2013 John W. Eaton ## ## This file is part of Octave. ## ## Octave is free software; you can redistribute it and/or modify it ## under the terms of the GNU General Public License as published by ## the Free Software Foundation; either version 3 of the License, or (at ## your option) any later version. ## ## Octave is distributed in the hope that it will be useful, but ## WITHOUT ANY WARRANTY; without even the implied warranty of ## MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU ## General Public License for more details. ## ## You should have received a copy of the GNU General Public License ## along with Octave; see the file COPYING. If not, see ## <http://www.gnu.org/licenses/>. ## -*- texinfo -*- ## @deftypefn {Function File} {} record (@var{sec}) ## @deftypefnx {Function File} {} record (@var{sec}, @var{fs}) ## Record @var{sec} seconds of audio from the system's default audio input at ## a sampling rate of 8000 samples per second. If the optional argument ## @var{fs} is given, it specifies the sampling rate for recording. ## ## For more control over audio recording, use the @code{audiorecorder} class. ## @seealso{@audiorecorder/audiorecorder} ## @end deftypefn function x = record (sec, fs) if (nargin == 1) fs = 8000; elseif (nargin != 2) print_usage (); endif rec = audiorecorder (fs, 16, 1); recordblocking (rec, sec); x = getaudiodata (rec); endfunction ## No test possible for recording audio. %!assert (1)