[GH-ISSUE #101] Retrieve the whole file instead of chunks #10

Closed
opened 2026-02-27 08:11:25 +03:00 by kerem · 4 comments
Owner

Originally created by @staniel359 on GitHub (Dec 21, 2021).
Original GitHub issue: https://github.com/kokarare1212/librespot-python/issues/101

Hello.
I've noticed that stream.input_stream.stream().read() command retrieves audio file by chunks, one by one, which takes time.
Is there a reason why it doesn't download the whole file?

Originally created by @staniel359 on GitHub (Dec 21, 2021). Original GitHub issue: https://github.com/kokarare1212/librespot-python/issues/101 Hello. I've noticed that `stream.input_stream.stream().read()` command retrieves audio file by chunks, one by one, which takes time. Is there a reason why it doesn't download the whole file?
kerem 2026-02-27 08:11:25 +03:00
  • closed this issue
  • added the
    question
    label
Author
Owner

@kokarare1212 commented on GitHub (Dec 21, 2021):

It has already been implemented.
You can now get all streams by entering a number less than or equal to 0 in the read argument.
Please refer to the following code.
github.com/kokarare1212/librespot-python@447c4f4116/librespot/audio/init.py#L150-L198

<!-- gh-comment-id:999166262 --> @kokarare1212 commented on GitHub (Dec 21, 2021): It has already been implemented. You can now get all streams by entering a number less than or equal to 0 in the read argument. Please refer to the following code. https://github.com/kokarare1212/librespot-python/blob/447c4f41162752b97f5dbbd087248a8daefea5ca/librespot/audio/__init__.py#L150-L198
Author
Owner

@staniel359 commented on GitHub (Dec 22, 2021):

@kokarare1212 I tried entering 0, but seems like it is already a default value.

What I see is this:
изображение
43 chunks are processed one by one.
Is it possible to process the whole file at once?

<!-- gh-comment-id:999442148 --> @staniel359 commented on GitHub (Dec 22, 2021): @kokarare1212 I tried entering `0`, but seems like it is already a default value. What I see is this: ![изображение](https://user-images.githubusercontent.com/18214933/147073665-000f2486-0f10-478b-878a-26f1e9074e65.png) 43 chunks are processed one by one. Is it possible to process the whole file at once?
Author
Owner

@kokarare1212 commented on GitHub (Dec 22, 2021):

I'm sure it's technically possible but I don't think this is realistic because it will be slow to retry when network or other errors occur.
The upstream librespot-java also uses the current method.

<!-- gh-comment-id:999463107 --> @kokarare1212 commented on GitHub (Dec 22, 2021): I'm sure it's technically possible but I don't think this is realistic because it will be slow to retry when network or other errors occur. The upstream librespot-java also uses the current method.
Author
Owner

@staniel359 commented on GitHub (Dec 22, 2021):

@kokarare1212 I see, thanks.

<!-- gh-comment-id:999466360 --> @staniel359 commented on GitHub (Dec 22, 2021): @kokarare1212 I see, thanks.
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
starred/librespot-python-kokarare1212#10
No description provided.