AudioGenerator

AudioGenerator[model]

generates one second of audio of a given model.

AudioGenerator[model,t]

generates t seconds of audio.

AudioGenerator[model,t,"type"]

generates audio samples of the specified "type".

Details and Options

  • AudioGenerator can generate different types of audio, including oscillators or noises.
  • Possible settings for model include:
  • Silence:
  • "Silence"silence (zero) signal
  • Oscillators:
  • {"Sin",freq,phase}sine wave
    {"Triangle",freq,phase}triangle wave
    {"Sawtooth",freq,phase}sawtooth wave
    {"Square",freq,phase}square wave
    {"Pulse",freq,phase,width}rectangular wave using the duty cycle width
    {"Impulse",freq,phase}impulse signal
  • By default, freq=TemplateBox[{440, "Hz", hertz, "Hertz"}, Quantity], phase=TemplateBox[{0, "rad", radians, "Radians"}, Quantity], and width=TemplateBox[{25, "%", percent, "Percent"}, QuantityPostfix] are used.
  • The parameters freq, phase, and width can be a scalar value, a Quantity, an Audio object, a TimeSeries, or a pure function.
  • Noise:
  • "White"constant power spectral density
    "Pink"power spectral density that follows 1/f
    "Brown"power spectral density that follows
    "Blue"power spectral density that follows
    {"Color",α}power spectral density that follows with
    {"White",dist}random noise with values sampled from dist
    "PeriodicRandomNoise"sum of sinusoidal components with constant amplitude and random phase
  • Other:
  • fsample an arbitrary function f of time (in seconds)
    procgenerate samples from a random process proc
    tseriesgenerate samples from a TimeSeries tseries
  • AudioGenerator generates an audio object of "Real32" type. See the reference page for Audio for possible settings of "type".
  • AudioGenerator has the same options as Audio.

Examples

open allclose all

Basic Examples  (3)

Generate one second of sinusoidal audio:

In[1]:=
Click for copyable input
Out[1]=

Generate two seconds of white noise:

In[1]:=
Click for copyable input
Out[1]=

Specify the frequency of a sinusoidal wave:

In[1]:=
Click for copyable input
Out[1]=

Control the frequency of the sinusoidal wave with a TimeSeries:

In[2]:=
Click for copyable input
Out[2]=

Scope  (17)

Options  (1)

Applications  (3)

Possible Issues  (2)

Interactive Examples  (3)

Neat Examples  (8)

See Also

Audio  ListPlay  Play  SampledSoundList  RandomVariate  RandomFunction  RandomReal  Sin  SawtoothWave  TriangleWave  SquareWave

Tutorials

Introduced in 2016
(11.0)