Spaces:
Sleeping
Sleeping
Download tests/create_sample.py from Pandaisop/voice-detection-api: direct link, hf CLI and curl.
- Browser
- Download file 384 Bytes
-
https://huggingface.co/spaces/Pandaisop/voice-detection-api/resolve/main/tests/create_sample.py
- Command line
-
hf download hf://spaces/Pandaisop/voice-detection-api/tests/create_sample.py
-
curl -L -o create_sample.py https://huggingface.co/spaces/Pandaisop/voice-detection-api/resolve/main/tests/create_sample.py
384 Bytes
| import numpy as np | |
| import soundfile as sf | |
| import os | |
| # Create a 1-second silence file (16kHz mono) | |
| sr = 16000 | |
| duration = 1.0 | |
| audio = np.zeros(int(sr * duration)) | |
| output_dir = "tests" | |
| if not os.path.exists(output_dir): | |
| os.makedirs(output_dir) | |
| file_path = os.path.join(output_dir, "sample_silence.wav") | |
| sf.write(file_path, audio, sr) | |
| print(f"Created dummy audio at {file_path}") | |