en fr

Sysquake Pro – Table of Contents

Sysquake – Table of Contents

Sysquake for LaTeX – Table of Contents

Extension - Audio Input

This section describes functions which record sounds. Currently, these functions are available on Windows and macOS.



Record audio samples.


samples = audiorecord(t)
samples = audiorecord(t, options)


audiorecord(t) records audio samples for t seconds and returns them in an array of single numbers. On computers which support them, the default sample rate is 44.1 kHz and the default number of channels is 2 (stereo). The result has 2 columns (one per channel) and as many rows as samples.

audiorecord(t,options) uses the specified options, which are typically built with audiorecordset.


samples = audiorecord(1);

See also

audiorecordset, audioplay


Options for audio.


options = audiorecordset
options = audiorecordset(name1=value1, ...)
options = audiorecordset(name1, value1, ...)
options = audiorecordset(options0, name1=value1, ...)
options = audiorecordset(options0, name1, value1, ...)


audiorecordset(name1,value1,...) creates the option argument used by audiorecord. Options are specified with name/value pairs, where the name is a string which must match exactly the names in the table below. Case is significant. Options which are not specified have a default value. The result is a structure whose fields correspond to each option. Without any input argument, audiorecordset creates a structure with all the default options. Note that audiorecord also interprets the lack of an option argument, or the empty array [], as a request to use the default values.

When its first input argument is a structure, audiorecordset adds or changes fields which correspond to the name/value pairs which follow.

Here is the list of permissible options:

SampleRate44100sample rate in Hz
Stereotruetrue for stereo, false for mono

Default values may be different on platforms with limited audio capabilities.


Default options:

  SampleRate: 44100
  Stereo: true

Record in mono:

samples = audiorecord(1, audiorecordset(Stereo=false));

See also