The Wolfram Language provides built-in support for both programmatic and interactive audio processing, fully integrated with the Wolfram Language's powerful mathematical and algorithmic capabilities. You can create and import sound files, manipulate them with built-in functions, apply linear and nonlinear filters, and visualize them in any number of ways.
Audio Creation and Representation
An audio object can be created from numerical arrays, files, and URLs.
This plots the spectrogram of an audio signal using partitions of length 512 and the offset 64:
Many useful audio processing tasks require nothing more than simple arithmetic operations between two audio objects or an audio object and a constant. For example, you can change volume by multiplying an audio object by a constant factor or by adding (subtracting) a constant to (from) an audio object. For this purpose, all Wolfram Language operators and functions with attributes NumericFunction or Listable are overloaded to work with audio objects.
Some arithmetical and statistical operations on audio objects.
This creates a linear combination of two audio objects:
This computes the mean of a list of audio objects:
This computes statistics of an audio object:
A system option called "IndeterminateValue" is used to replace values that can result from arithmetical operation but cannot be stored in an audio object. These include ComplexInfinity and Indeterminate.
This displays the current value of the "IndeterminateValue" option and changes it to 2:
This shows how "IndeterminateValue" is used to replace unacceptable values in the result of an arithmetical operation:
Complex numbers in the result of an arithmetical operation are replaced by the real parts of these values:
Change the "IntermediateValue" back to the default zero:
Consider the audio manipulation operations that change the audio duration by trimming, deleting, or padding. These operations serve a variety of useful purposes. Trimming and deleting allow you to create a new audio object from a selected portion of a larger one, while padding is typically used to extend an audio object at the ends to ensure uniform treatment of the end samples in many audio processing tasks.