Download scripts/_check_wav.py from build-small-hackathon/phantom-grid: direct link, hf CLI and curl.
- Browser
- Download file 662 Bytes
-
https://huggingface.co/spaces/build-small-hackathon/phantom-grid/resolve/4f670ea00a0db95a9e7dc6d80aa620e07d0e048f/scripts/_check_wav.py
- Command line
-
hf download hf://spaces/build-small-hackathon/phantom-grid@4f670ea00a0db95a9e7dc6d80aa620e07d0e048f/scripts/_check_wav.py
-
curl -L -o _check_wav.py https://huggingface.co/spaces/build-small-hackathon/phantom-grid/resolve/4f670ea00a0db95a9e7dc6d80aa620e07d0e048f/scripts/_check_wav.py
662 Bytes
| import contextlib | |
| import wave | |
| from pathlib import Path | |
| for p in [ | |
| Path(r"C:\temp\shadow_commission_london_maps_backup_20260611_183156\runtime\MiniCPM-o-Demo\assets\ref_audio\ref_en_dlc_1.wav"), | |
| Path(r"C:\temp\shadow_commission_london_maps_backup_20260611_183156\runtime\MiniCPM-o-Demo\assets\ref_audio\ref_minicpm_signature.wav"), | |
| Path(r"C:\temp\shadow_commission_london_maps_backup_20260611_183156\data\voices\voice_01.wav"), | |
| ]: | |
| with contextlib.closing(wave.open(str(p), "r")) as w: | |
| dur = w.getnframes() / w.getframerate() | |
| print(f"{p.name}: {w.getframerate()} Hz, {w.getnchannels()} ch, {w.getsampwidth() * 8}-bit, {dur:.2f}s") | |