generate audio_scp files from url input for speaker diarization.
(urls: Union[tuple, list])
| 302 | |
| 303 | |
| 304 | def generate_sd_scp_from_url(urls: Union[tuple, list]): |
| 305 | """ |
| 306 | generate audio_scp files from url input for speaker diarization. |
| 307 | """ |
| 308 | audio_scps = [] |
| 309 | for url in urls: |
| 310 | if os.path.exists(url) and ( |
| 311 | url.lower().endswith(SUPPORT_AUDIO_TYPE_SETS)): |
| 312 | audio_scp = url |
| 313 | else: |
| 314 | result = urlparse(url) |
| 315 | if result.scheme is not None and len(result.scheme) > 0: |
| 316 | storage = HTTPStorage() |
| 317 | wav_bytes = storage.read(url) |
| 318 | audio_scp = wav_bytes |
| 319 | else: |
| 320 | raise ValueError("Can't download from {}.".format(url)) |
| 321 | audio_scps.append(audio_scp) |
| 322 | return audio_scps |
| 323 | |
| 324 | |
| 325 | def update_local_model(model_config, model_path, extra_args): |
nothing calls this directly
no test coverage detected
searching dependent graphs…