AudioResample[audio,sr]
resamples audio to have the sample rate of sr.
AudioResample[video,sr]
resamples the first audio track in video to have the sample rate of sr.
AudioResample
AudioResample[audio,sr]
resamples audio to have the sample rate of sr.
AudioResample[video,sr]
resamples the first audio track in video to have the sample rate of sr.
Details and Options
- AudioResample can be used to convert between any sampling rates, including the common ones, e.g. telephone, CD and DVD.
- The sample rate sr can be given as a positive integer, assumed to be in hertz, a quantity, or a Scaled parameter.
- The following common sampling rates are also supported:
-
"Telephone" 8000 used for telephone signal "CD" 44100 used in audio CD, MP3, etc. "DVD" 48000 DVD, professional video equipment, etc. "DVDAudio" 96000 DVD-Audio, Blu-ray, etc. - AudioResample works with Audio objects of any number of channels.
- The following options can be given:
-
Antialiasing True whether to antialias when downsampling Padding 0 padding method Resampling Automatic resampling method - For possible settings for Padding, see the reference page for AudioPad.
Examples
open all close allBasic Examples (1)
Scope (4)
Specify the sample rate using a frequency Quantity:
a = AudioGenerator["Sin"];AudioResample[a, Quantity[11025, "Hertz"]]//AudioSampleRateSpecify the sample rate using a Scaled value:
a = AudioGenerator["Sin"];AudioResample[a, Scaled[.25]]//AudioSampleRateSpecify the sample rate using a preset value:
a = AudioGenerator["Sin"];AudioResample[a, "Telephone"]//AudioSampleRateProcess the audio track of a video:
AudioResample[\!\(\*VideoBox[""]\), 16000]//AudioSampleRateOptions (3)
Antialiasing (1)
When resampling to a lower sample rate, an antialiasing filter is applied by default:
a = AudioGenerator[{"Sin", 3500}, SampleRate -> 8000] + AudioGenerator[{"Sin", 1500}, SampleRate -> 8000];
Spectrogram[a]Resampling by a factor of .5 with antialiasing filter:
Spectrogram[AudioResample[a, 4000]]Use Antialiasing->False:
Spectrogram[AudioResample[a, 4000, Antialiasing -> False]]Padding (1)
Applications (2)
Convert an audio object in CD quality (44.1 KHz) to DVD quality (48 KHz):
a = ExampleData[{"Sound", "RollingCoin"}, "Audio"];
dvd = AudioResample[a, "DVD"]AudioSampleRate /@ {a, dvd}Resampling to a lower sample rate reduces the memory used by the audio object:
a = ExampleData[{"Sound", "RollingCoin"}, "Audio"];
t = Table[AudioResample[a, sr], {sr, {48000, 44100, 32000, 22050, 11025, 8000}}];TableForm[{AudioSampleRate[#], Quantity[ByteCount[#], "Bytes"]}& /@ t, TableHeadings -> {None, {"sample rate", "memory"}}]Related Guides
Text
Wolfram Research (2016), AudioResample, Wolfram Language function, https://reference.wolfram.com/language/ref/AudioResample.html (updated 2024).
CMS
Wolfram Language. 2016. "AudioResample." Wolfram Language & System Documentation Center. Wolfram Research. Last Modified 2024. https://reference.wolfram.com/language/ref/AudioResample.html.
APA
Wolfram Language. (2016). AudioResample. Wolfram Language & System Documentation Center. Retrieved from https://reference.wolfram.com/language/ref/AudioResample.html
BibTeX
@misc{reference.wolfram_2026_audioresample, author="Wolfram Research", title="{AudioResample}", year="2024", howpublished="\url{https://reference.wolfram.com/language/ref/AudioResample.html}", note=[Accessed: 13-June-2026]}
BibLaTeX
@online{reference.wolfram_2026_audioresample, organization={Wolfram Research}, title={AudioResample}, year={2024}, url={https://reference.wolfram.com/language/ref/AudioResample.html}, note=[Accessed: 13-June-2026]}