if file is None:
            token_per_repo_id = token_per_repo_id or {}
            source_url = path.split("::")[-1]
            pattern = (
                config.HUB_DATASETS_URL if source_url.startswith(config.HF_ENDPOINT) else config.HUB_DATASETS_HFFS_URL
            )
            try:
                repo_id = string_to_dict(source_url, pattern)["repo_id"]
                token = token_per_repo_id[repo_id]
            except (ValueError, KeyError):
                token = None

            download_config = DownloadConfig(token=token)
            with xopen(path, "rb", download_config=download_config) as f:
                array, sampling_rate = sf.read(f)

        else:
            array, sampling_rate = sf.read(file)