Caution

You're reading an old version of this documentation. If you want up-to-date information, please have a look at 0.9.1.

librosa.core.get_samplerate

librosa.core.get_samplerate(path)[source]

Get the sampling rate for a given file.

Parameters
pathstring, int, or file-like

The path to the file to be loaded As in load(), this can also be an integer or open file-handle that can be processed by soundfile.

Returns
srnumber > 0

The sampling rate of the given audio file

Examples

Get the sampling rate for the included audio file

>>> path = librosa.util.example_audio_file()
>>> librosa.get_samplerate(path)
44100