AudioRecord

AudioRecord[]

returns a new AudioStream object and starts to record from the default input audio device.

AudioRecord[inputdev]

records from the input audio device inputdev.

AudioRecord[astream]

starts recording an AudioStream object astream that is connected to an input device.

Details and Options

  • AudioRecord can be used to perform programmatic audio capture from any input audio device.
  • The inputdev can be any device available in $AudioInputDevices.
  • With multiple streams connected to the same device, only one stream can record at a given time.
  • Use AudioPause or AudioStop to pause or stop the recording.
  • Audio[astream] returns an Audio object including all the captured data available in astream.
  • The following options can be given:
  • MaxDurationmaximum duration of recording
    MethodAutomaticmethod settings to use
  • AudioRecord records until the stream is paused or stopped. Use MaxDuration->dur to record for the specified duration dur.
  • By default, the recorded audio is placed under the "Audio" directory in $WolframDocumentsDirectory.
  • Use Method->{"StorageLocation"->loc} to specify the location of the generated signal. Possible settings for loc include:
  • Automatican audio object linking to a file with automatically generated name
    filean audio object linking to file
    "Memory"an in-memory audio object

Examples

open allclose all

Basic Examples  (1)

Create an input stream and start recording:

Stop the recording:

Create an audio object from the recorded stream:

Scope  (3)

Create an input stream and start recording from a specific device:

Stop the recording:

Start the recording of an existing AudioStream:

Stop the recording:

AudioPause keeps the information about the recording position and the data:

AudioStop resets the recording:

Options  (2)

MaxDuration  (1)

Use MaxDuration to set the maximum duration of the recording:

Method  (1)

Use the Method option to control the storage location for the recording:

If "Memory" is specified, an in-core Audio object is created:

Properties & Relations  (1)

Unlike AudioCapture, AudioRecord does not block the kernel:

Possible Issues  (1)

Only a single stream can record from a specific device at any time:

Stop the first recording and try again:

Introduced in 2018
 (11.3)
 |
Updated in 2020
 (12.1)