AudioPad
Details
- The amount of padding can be a non-negative real number in seconds, a time quantity, or a samples quantity.
- The following forms of padding can be specified:
-
0 zero (silence) padding val a constant value "Faded" a short faded padding followed by zero padding "Fixed" repetitions of the boundary value "Periodic" cyclic repetitions of the complete audio "Reflected" reflections of the audio at the boundary "Reversed" reversals of the complete audio
Examples
open all close allBasic Examples (2)
Add two seconds of silence to the end of an audio object:
AudioPad[\!\(\*AudioBox[""]\), 2]AudioPlot[%]Add a second of silence to both ends:
AudioPad[\!\(\*AudioBox[""]\), {1, 1}]AudioPlot[%]Scope (6)
Pad an audio object with silence:
a = ExampleData[{"Sound", "BassFlute"}, "Audio"];AudioPad[a, Duration[a], 0]//AudioPlotAudioPad[a, Duration[a], "Periodic"]//AudioPlotPad the audio with its reverse:
AudioPad[a, Duration[a], "Reversed"]//AudioPlotPad an audio object with silence:
a = AudioGenerator[{"Sawtooth", 1, Pi}, .99];
AudioPlot[a]AudioPad[a, Duration[a], 0]//AudioPlotAudioPad[a, Duration[a], .5]//AudioPlotPad with a repetition of the boundary value:
AudioPad[a, Duration[a], "Fixed"]//AudioPlotAudioPad[a, Duration[a], "Periodic"]//AudioPlotPad the audio with its reverse:
AudioPad[a, Duration[a], "Reversed"]//AudioPlotPad the audio with a short decay to zero:
AudioPad[a, Duration[a], "Faded"]//AudioPlotAdd a second of silence to the beginning and the end:
a = ExampleData[{"Sound", "BassFlute"}, "Audio"];AudioPad[a, {1, 1}]//AudioPlotSpecify the amount of padding as a time quantity:
a = ExampleData[{"Sound", "BassFlute"}, "Audio"];AudioPad[a, Quantity[2, "Seconds"]]//AudioPlotSpecify the amount of padding as a samples quantity:
a = ExampleData[{"Sound", "BassFlute"}, "Audio"];AudioPad[a, Quantity[20000, "Samples"]]//AudioPlota = \!\(\*AudioBox[""]\);
AudioPlot[a]AudioPad[a, Quantity[3, "Seconds"]]//AudioPlotApplications (4)
Use faded padding to avoid clicks:
a = AudioGenerator[{"Sin", 400, .5}]AudioPad[a, {.5, .5}, "Faded"]Add padding to an audio object before applying a reverb:
audio = AudioPad[\!\(\*AudioBox[""]\), 6];AudioReverb[audio, "LargeHall"]Pad an audio object before an AudioJoin operation:
audio1 = \!\(\*AudioBox[""]\);
audio2 = \!\(\*AudioBox[""]\);AudioJoin[{AudioPad[audio1, 1], AudioPad[audio2, 1]}]Pad an audio object to match the duration of a different one:
audio1 = \!\(\*AudioBox[""]\);
audio2 = \!\(\*AudioBox[""]\);AudioPad[audio1, Duration[audio2] - Duration[audio1]]Duration /@ {%, audio2}Related Guides
Related Workflows
- Record a Sound
Text
Wolfram Research (2016), AudioPad, Wolfram Language function, https://reference.wolfram.com/language/ref/AudioPad.html (updated 2017).
CMS
Wolfram Language. 2016. "AudioPad." Wolfram Language & System Documentation Center. Wolfram Research. Last Modified 2017. https://reference.wolfram.com/language/ref/AudioPad.html.
APA
Wolfram Language. (2016). AudioPad. Wolfram Language & System Documentation Center. Retrieved from https://reference.wolfram.com/language/ref/AudioPad.html
BibTeX
@misc{reference.wolfram_2026_audiopad, author="Wolfram Research", title="{AudioPad}", year="2017", howpublished="\url{https://reference.wolfram.com/language/ref/AudioPad.html}", note=[Accessed: 12-June-2026]}
BibLaTeX
@online{reference.wolfram_2026_audiopad, organization={Wolfram Research}, title={AudioPad}, year={2017}, url={https://reference.wolfram.com/language/ref/AudioPad.html}, note=[Accessed: 12-June-2026]}