Spaces:
Sleeping
Sleeping
Download app/utils/audio.py from oshul/ops-checklist-agent: direct link, hf CLI and curl.
- Browser
- Download file 427 Bytes
-
https://huggingface.co/spaces/oshul/ops-checklist-agent/resolve/main/app/utils/audio.py
- Command line
-
hf download hf://spaces/oshul/ops-checklist-agent/app/utils/audio.py
-
curl -L -o audio.py https://huggingface.co/spaces/oshul/ops-checklist-agent/resolve/main/app/utils/audio.py
427 Bytes
| """Audio file handling utilities.""" | |
| ALLOWED_AUDIO_TYPES = [ | |
| "audio/webm", | |
| "audio/ogg", | |
| "audio/wav", | |
| "audio/mpeg", | |
| "audio/mp4", | |
| ] | |
| def validate_audio_type(content_type: str | None) -> bool: | |
| """Check if the uploaded file has a valid audio content type.""" | |
| if not content_type: | |
| return True # Allow if no content type (browser may not send it) | |
| return content_type in ALLOWED_AUDIO_TYPES | |