# Wolfram Mathematica

## Use Time Series to Generate Audio

Control the frequency of the sine wave with a regularly sampled TimeSeries.

In:= ```n = 50; frequencies = RandomReal[{100, 300}, n]; reg = TimeSeries[frequencies, {0, Automatic, .3}];```
In:= `AudioGenerator[{"Sin", reg}]`

Control the frequency of the sine wave with an irregularly sampled TimeSeries.

In:= ```times = Accumulate[RandomReal[{0.1, .5}, n]]; irreg = TimeSeries[frequencies, {times}];```
In:= `AudioGenerator[{"Sin", irreg}]`

Generate a white noise with WhiteNoiseProcess.

In:= `sample = RandomFunction[WhiteNoiseProcess[1/3], {88200}]`
Out= Rescale the sample to the length of 2 seconds and generate audio.

In:= ```AudioNormalize@ AudioGenerator[TimeSeriesRescale[sample, {0, 2, 1/44100}]]```
In:= ```AudioNormalize@ AudioGenerator[TimeSeriesRescale[sample, {0, 2, 1/44100}]]; AudioPlot[%]```
Out= Generate a different type of noise directly with FractionalGaussianNoiseProcess.

In:= `AudioNormalize@AudioGenerator[FractionalGaussianNoiseProcess[1/3], 2]`
In:= ```AudioNormalize@AudioGenerator[FractionalGaussianNoiseProcess[1/3], 2]; AudioPlot[%]```
Out= 