Skip to content

Output WAV still seems to have problems if there's loop header section #63

@segfault-bilibili

Description

@segfault-bilibili
  • Fix offset miscalculation bug

Should be within this function: https://github.com/segfault-bilibili/DereTore/blob/c364976c6e38fb128dccab3aed1d3caf888114a8/Exchange/DereTore.Exchange.Audio.HCA/HcaDecoder.cs#L23

I probably know what's going on. GetMinWaveHeaderBufferSize() added the size of WaveSampleSection 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 include WaveSampleSection... Now I just hesitate to write WaveSampleSection - I don't know what this section is for, a simple solution would be just comment out that if (hcaInfo.LoopFlag) {...} lines in GetMinWaveHeaderBufferSize. Copied what https://github.com/segfault-bilibili/hca.js is doing, won't hurt at least...


- [ ] Re-decode the "seam" block maybe this is not needed at all. Related: Nyagamon/HCADecoder#4

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions