Skip to content

ReadWAV() returns incorrect sample rate #34

Closed
@swharden

Description

@swharden

Content originally posted by @shirok1 in #33:


Wrong sampleCount expression in ReadWAV (readme.md)

int sampleCount = (int) (afr.Length / afr.WaveFormat.BitsPerSample / 8);

image

I guess this sampleCount is an estimation of the final size of the List<double> audio. However, 253296 is 64 times smaller than 16210944. So the most reasonable explanation is /8 is a typo of *8.

image

This "typo" causes the birth of garbage twice as large as the audio itself.

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