def load_audio(path, sample_length=64000, sr=16000):
"""Loading of a wave file.
Args:
path: Location of a wave file to load.
sample_length: The truncated total length of the final wave file.
sr: Samples per a second.
Returns:
out: The audio in samples from -1.0 to 1.0
"""
audio, _ = librosa.load(path, sr=sr)
audio = audio[:sample_length]
return audio
评论列表
文章目录