AudioData

AudioData[audio]

gives an array of audio samples.

AudioData[audio,"type"]

gives an array of audio samples converted to the specified "type".

Details and Options

  • By default, AudioData[audio] normalizes values to lie between and 1.
  • AudioData returns a 2D array of data, where rows correspond to channels.
  • The number of samples in each channel is equivalent to the duration of the audio multiplied by the sample rate.
  • Possible types specified by AudioData[audio,"type"] are:
  • "SignedInteger8"signed 8-bit integers from through
    "SignedInteger16"signed 16-bit integers from through
    "SignedInteger32"signed 32-bit integers from through
    "Real32"single-precision real (32 bit)
    "Real"double-precision real (64 bit)
  • AudioData[audio,Automatic] is equivalent to AudioData[audio,AudioType[audio]].
  • For multichannel audio objects, AudioData returns the data in the form {{v11,v12,},{v21,v22,},}, with values vij corresponding to channel i.
  • Use the option Interleaving->True to get interleaved data.

Examples

open allclose all

Basic Examples  (1)

Extract data from an Audio object:

In[1]:=
Click for copyable input
Out[1]//Short=
In[2]:=
Click for copyable input
Out[2]=

Scope  (1)

Generalizations & Extensions  (1)

Options  (1)

Applications  (2)

See Also

Audio  SampleRate  Duration  AudioType  SampledSoundList  ListPlay

Introduced in 2016
(11.0)
| Updated in 2017
(11.2)