view scripts/audio/record.m @ 19714:890ff06d84ce

record.m: Remove seealso link to @audiorecorder which stops docs building. * record.m: Remove seealso link to @audiorecorder which stops docs building.
author Rik <rik@octave.org>
date Sun, 08 Feb 2015 12:10:05 -0800
parents 0f557da98f5b
children f96671da51a6
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.
## @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)