AudioSampleRate[audio]
returns the sample rate of the Audio object audio.
AudioSampleRate[video]
returns the sample rate of the first audio track of video.
AudioSampleRate
AudioSampleRate[audio]
returns the sample rate of the Audio object audio.
AudioSampleRate[video]
returns the sample rate of the first audio track of video.
Examples
open all close allBasic Examples (3)
Sample rate of an Audio object:
AudioSampleRate[\!\(\*AudioBox[""]\)]Sample rate of an audio linking to a local file:
a = Audio["ExampleData/rule30.wav"]AudioSampleRate[a]Import["ExampleData/rule30.wav", "SampleRate"]Sample rate of the audio track in a video:
AudioSampleRate[\!\(\*VideoBox[""]\)]Properties & Relations (4)
The sample rate can be imported directly from files:
ExampleData[{"Sound", "Apollo11PhoneCall"}, "SampleRate"]AudioSampleRate[ExampleData[{"Sound", "Apollo11PhoneCall"}, "Audio"]]Use AudioResample to change the sample rate of an audio:
a = Audio["ExampleData/rule30.wav"]AudioSampleRate[a]AudioResample[a, 22050]//AudioSampleRateThe sample rate of an audio can be computed by dividing AudioLength by Duration:
a = \!\(\*AudioBox[""]\);AudioSampleRate[a]QuantityMagnitude[AudioLength[a] / Duration[a]]For Audio, dividing the number of samples by the sample rate is equivalent to the duration:
a = AudioGenerator["Sin", 2.5]This could be achieved by dividing AudioLength by AudioSampleRate:
QuantityMagnitude[AudioLength[a] / AudioSampleRate[a]]//NRelated Guides
Text
Wolfram Research (2016), AudioSampleRate, Wolfram Language function, https://reference.wolfram.com/language/ref/AudioSampleRate.html (updated 2021).
CMS
Wolfram Language. 2016. "AudioSampleRate." Wolfram Language & System Documentation Center. Wolfram Research. Last Modified 2021. https://reference.wolfram.com/language/ref/AudioSampleRate.html.
APA
Wolfram Language. (2016). AudioSampleRate. Wolfram Language & System Documentation Center. Retrieved from https://reference.wolfram.com/language/ref/AudioSampleRate.html
BibTeX
@misc{reference.wolfram_2026_audiosamplerate, author="Wolfram Research", title="{AudioSampleRate}", year="2021", howpublished="\url{https://reference.wolfram.com/language/ref/AudioSampleRate.html}", note=[Accessed: 12-June-2026]}
BibLaTeX
@online{reference.wolfram_2026_audiosamplerate, organization={Wolfram Research}, title={AudioSampleRate}, year={2021}, url={https://reference.wolfram.com/language/ref/AudioSampleRate.html}, note=[Accessed: 12-June-2026]}