Caution
You're reading the documentation for a development version. For the latest released version, please have a look at 0.10.2.
librosa.get_samplerate
- librosa.get_samplerate(path)[source]
Get the sampling rate for a given file.
- Parameters:
- pathstring, int, soundfile.SoundFile, 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 bysoundfile
. An existingsoundfile.SoundFile
object can also be supplied.
- Returns:
- srnumber > 0
The sampling rate of the given audio file
Examples
Get the sampling rate for the included audio file
>>> path = librosa.ex('trumpet') >>> librosa.get_samplerate(path) 22050