-
Notifications
You must be signed in to change notification settings - Fork 28
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
HcaAudioStream doesn't seem to be seekable #65
Comments
Ah, the fact that |
On the other hand, I think in a common streaming scenario, it should assume that the beginning part, rather than the following/ending part, is available. |
Hmm... Maybe making HcaAudioStream seekable isn't as challenging as I thought. However, anyway, because of the fact that every block depends on the state decided by its prior block to be correctly decoded, the beginning part still has to be (in the first place: available - and then) decoded in order, only after that could the decoder then hand out decoded WAV PCM data. |
Hmm... As for:
I think even if, like, the user drags the timeline/progress bar to skip some part in the beginning, (strictly saying) the decode still has no choice but to download & decode all prior blocks in spite of the fact that those block will probably never be used/played. (However, according to my rough observation, the "effect" won't last for more than 1 block, so maybe fetching & decoding 2 prior blocks (rather than the whole part up to the beginning) is already enough) |
Ah, after skimming VGAudio's related code (related: Nyagamon/HCADecoder#4 ), I think maybe (still not very sure) this "state/context" dependence problem shouldn't be as important as I originally thought. |
I'm not majored in IT-related subjects. I'm not sure whether I misunderstand something for now, however I think something is (potentially) wrong.
The HCA (2.0, CBR?) decoding process seems to be "stateful" to me. Each block is not decoded "independently", let alone "disorderly". Every block relies on the state (decided/affected by its prior block) to be correctly decoded.
Currently
EnsureSoundDataDecoded
/EnsureSoundDataDecodedWithLoops
takesposition
(in the name ofwaveDataOffset
) as an argument - so what would happen if the stream got seeked? I haven't thought about this thoroughly, but I doubt whether the current code could correctly handle this.The text was updated successfully, but these errors were encountered: