Skip to content

audiorecorder

audio · scripts/audio/audiorecorder.m

AUDIORECORDER  Record audio from an audio input device.

  R = AUDIORECORDER
  R = AUDIORECORDER (FS, NBITS, NCHANNELS)
  R = AUDIORECORDER (FS, NBITS, NCHANNELS, ID)

  FS is the sample rate in Hz (default 8000), NBITS the resolution (8, 16
  or 24; default 8), NCHANNELS the number of channels (default 1) and ID
  the input device (see AUDIODEVINFO; -1 or omitted selects the system
  default).

  Methods: record, recordblocking, pause, resume, stop, isrecording,
  getaudiodata, getplayer, play, get, set.  Properties: SampleRate,
  BitsPerSample, NumberOfChannels, DeviceID, CurrentSample, TotalSamples,
  Running, Tag, UserData, StartFcn, StopFcn, TimerFcn, TimerPeriod, Type.

  The recorder is a handle object.  Capture uses the Java Sound API of the
  bundled Java runtime.  Nexus has no background thread to move captured
  samples into the recording, so the samples collected by the device are
  fetched whenever the recorder is used (any method, property read or
  RECORDBLOCKING); the device buffers about 20 seconds of audio meanwhile.
  With RECORD (R, T) the recording stops by itself after T seconds, noticed
  at the next use of the recorder.  Without a usable audio device RECORD
  raises an error.