Hugging Face
Models
Datasets
Spaces
Community
Docs
Enterprise
Pricing
Log In
Sign Up
Spaces:
zinoubm
/
ClientTest
like
0
Runtime error
App
Files
Files
Community
Fetching metadata from the HF Docker repository...
7fc3da4
ClientTest
/
utils.py
zinoubm
final touches
2f9dcad
almost 3 years ago
raw
Copy download link
history
blame
204 Bytes
import
librosa
import
soundfile
as
sf
def
compress
(
audio_file
):
y, s = librosa.load(audio_file, sr=
8000
)
# Downsample 44.1kHz to 8kHz
sf.write(audio_file, y, s,
"PCM_24"
)
return
audio_file