Skip to content

[raudio] WaveCrop() is broken #3993

@ListeriaM

Description

@ListeriaM

initSample is treated as being in both [frames] and [frames * channels] units. This was probably an oversight in 7f6cd93 as initSample is still multiplied by wave->channels in the call to memcpy(3) which renders the function unusable.

Although I think it would make more sense for initSample and finalSample to be measured in [frames] (and renamed to initFrame and endFrame), as I can't think of a reason to support splitting frames, because with interleaved channel data, you may end up getting different starting and ending offsets for different channels, and the channels' data would be shifted, i.e: the n'th channel would have the data for the k'th channel, with k = (n + initSamples) % wave->channels.

I can make a PR for this if needed, but unless there's a good reason for using samples, I'd go ahead and use frames instead.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions