-
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
Output WAV still seems to have problems if there's loop header section #63
Comments
I see "unknown chunk" after PCM sample data. I don't know what it is, but it doesn't seem to disturb anything... |
Ah, the same bug I had once created & then fixed😂 segfault-bilibili/hca.js@3804499
|
At least the "seam" block (at the start of looped blocks) itself should be re-decoded. I'm not sure whether more blocks should be re-decoded, however the affected bytes don't seem to be enough to make a full block - in other words, reworking one block seems to be enough to make the output byte-to-byte exactly the same to "stupidly" decoding every block including looped ones.
|
Still not sure what happend, but something must be wrong - I tested with an HCA with its What makes this an issue is, this seems to be caused by dozens of zero bytes inserted in the middle of PCM data...
|
Oh now we have two bugs😂 |
Should be within this function: https://github.com/segfault-bilibili/DereTore/blob/c364976c6e38fb128dccab3aed1d3caf888114a8/Exchange/DereTore.Exchange.Audio.HCA/HcaDecoder.cs#L23I probably know what's going on.
GetMinWaveHeaderBufferSize()
added the size ofWaveSampleSection
to the total header size. Then such WAV header probably failed to be written, which should be the unexpectedly inserted dozens of zero bytes, which will then confuse WAV parser/player.However I still don't understand why the size recorded in WAVRIFF header doesn't seem to includeWaveSampleSection
...Now I just hesitate to writeCopied what https://github.com/segfault-bilibili/hca.js is doing, won't hurt at least...WaveSampleSection
- I don't know what this section is for, a simple solution would be just comment out thatif (hcaInfo.LoopFlag) {...}
lines inGetMinWaveHeaderBufferSize
.- [ ] Re-decode the "seam" blockmaybe this is not needed at all. Related: Nyagamon/HCADecoder#4The text was updated successfully, but these errors were encountered: