AudioPlot

AudioPlot[audio]

plots the waveform of audio.

AudioPlot[{audio1,audio2,}]

plots waveforms of all audioi.

Details and Options

  • AudioPlot returns a single graphic showing the waveform corresponding to channels of audio.
  • AudioPlot has the same options as Graphics, with the following additions and changes:
  • Appearance Automaticappearance of the plot
    AspectRatio 1/6the aspect ratio of the plot
    Axes {True,False}whether to draw axes
    AxesOrigin {0,0}where axes should cross
    ColorFunction Automatichow to determine the coloring of waveforms
    ColorFunctionScaling Falsewhether to scale color function arguments
    FrameTruewhether to put a frame around the plot
    MaxPlotPoints Automaticmaximum number of samples to show
    PlotLayout Automaticthe layout to be used
    PlotRange Automaticrange of values to include
    PlotRangeClippingTruewhether to clip at the plot range
    PlotStyle Automaticthe styles in which objects are to be drawn
    PlotTheme $PlotThemeoverall theme for the plot
  • Possible settings for the Appearance option include:
  • "Continuous"continuous plot
    "Discrete"discrete plot
    "ContinuousAbs"continuous plot of absolute values
    "DiscreteAbs"discrete plot of absolute values
  • The plot layout can be specified as PlotLayout->{individual,combination}, where individual specifies the layout for each audio object, and combination specifies how to combine multiple audio objects.
  • Possible settings for individual include:
  • "Averaged"waveform of the average of the channels
    "Overlaid"overlaid waveforms of the channels
    "Vertical"waveform of channels in a vertical grid
  • Possible settings for combination layouts include:
  • "Overlaid"overlaid waveforms of the audio objects
    "Vertical"grid waveforms of objects in a vertical grid
  • PlotRange supports the following special settings:
  • t{{0,t},Automatic}plot the first t seconds
    {t1,t2}{{t1,t2},Automatic}plot the waveform from t1 to t2 seconds
  • The time specification ti can also be a time quantity (e.g. Quantity[0.1,"Minutes"]) or sample quantity (e.g. Quantity[1000,"Samples"]).

Examples

open allclose all

Basic Examples  (2)

Waveform of a mono audio object:

Waveform of a stereo audio object:

Scope  (9)

Basic Uses  (4)

A mono audio object:

A stereo audio object:

A multichannel audio object:

A list of audio objects:

Presentation  (5)

Plot the waveform without any frame or axes:

Specify the plot style:

Specify a plot theme:

Add an epilog to the audio plot:

Color the waveform with the corresponding value of the high-frequency content to localize onsets:

Options  (37)

Appearance  (4)

By default, a continuous waveform is shown for audio objects:

Show a discrete plot:

Show a discrete plot of absolute values:

The appearance elements are applied to channels of multichannel audio objects:

Discrete absolute plot for a stereo audio object:

Discrete plot for a list of audio objects:

It is possible to control the density of vertical bars in the "Discrete" and "DiscreteAbs" visualizations using the MaxPlotPoints option:

AspectRatio  (1)

AspectRatio controls the aspect ratio of the plot:

With "Vertical" layout, the setting of AspectRatio controls the aspect ratio of each waveform:

Axes  (1)

All the options related to Axes refer to the axes of the plots of the single channels:

AxesOrigin  (1)

AxesOrigin refers to the plots of the single channels:

ColorFunction  (5)

Color by a scaled coordinate and scaled coordinate, respectively:

Color a curve red when its absolute coordinate is above 0.6:

ColorFunction can be used to visualize properties of the audio object:

Compute the fundamental frequency of the audio object:

Delete the missing values and rescale it between 0 and 1:

Use the result so that the color of the waveform is proportional to the fundamental frequency at that time:

ColorFunction has higher priority than PlotStyle for coloring the waveform:

ColorFunction can be used with any setting of Appearance:

ColorFunctionScaling  (1)

No argument scaling on the left; automatic scaling on the right:

FillingStyle  (2)

Control the filling style:

Control the filling style channel by channel:

Control the filling style of multiple audio objects:

Control the filling style audio by audio:

Specify the filling style of the channels of each audio object:

FrameTicks  (5)

The Automatic setting will generate only two ticks for the axis independently of PlotRange:

It is possible to specify the FrameTicks for each axis:

Place tick marks at specified positions:

Place tick marks at specified positions with arbitrary labels:

Specify the ticks as a function:

MaxPlotPoints  (1)

MaxPlotPoints controls the maximum number of points displayed:

The smaller the number of points displayed, the more smoothing is applied:

PlotLabel  (2)

Add a label:

For multichannel audio, only one label is added to the whole plot:

PlotLayout  (3)

Choose among different plot layouts with a multichannel audio object:

Vertical layout:

Overlaid layout:

Averaged layout:

Choose between different plot layouts with a list of audio objects:

Vertical layout:

Overlaid layout:

Control the individual and combination layouts independently:

PlotRange  (4)

Plot only the first second of an audio object:

Specify the range using a time Quantity:

Use a "Samples" Quantity:

Plot the waveform between 100 and 120 ms:

Change the range of the axis:

PlotStyle  (4)

PlotStyle specifies the style in which the waveform is to be drawn:

Explicitly style each channel:

AudioPlot will automatically style multiple audio objects:

Control the style of multiple audio objects:

Explicitly style multiple audio objects:

Specify the style of the individual channels of each audio object:

PlotTheme  (3)

Use a theme with simple styling and a bright color scheme:

Change the color scheme:

Use minimal styling:

Applications  (3)

Highlight parts of an audio object:

Plot waveforms of audio files in a collection:

Show a TimeSeries on top of the waveform:

Interactive Examples  (1)

Build a dynamic waveform visualization:

Wolfram Research (2016), AudioPlot, Wolfram Language function, https://reference.wolfram.com/language/ref/AudioPlot.html.

Text

Wolfram Research (2016), AudioPlot, Wolfram Language function, https://reference.wolfram.com/language/ref/AudioPlot.html.

CMS

Wolfram Language. 2016. "AudioPlot." Wolfram Language & System Documentation Center. Wolfram Research. https://reference.wolfram.com/language/ref/AudioPlot.html.

APA

Wolfram Language. (2016). AudioPlot. Wolfram Language & System Documentation Center. Retrieved from https://reference.wolfram.com/language/ref/AudioPlot.html

BibTeX

@misc{reference.wolfram_2022_audioplot, author="Wolfram Research", title="{AudioPlot}", year="2016", howpublished="\url{https://reference.wolfram.com/language/ref/AudioPlot.html}", note=[Accessed: 29-May-2023 ]}

BibLaTeX

@online{reference.wolfram_2022_audioplot, organization={Wolfram Research}, title={AudioPlot}, year={2016}, url={https://reference.wolfram.com/language/ref/AudioPlot.html}, note=[Accessed: 29-May-2023 ]}