wave icon indicating copy to clipboard operation
wave copied to clipboard

readFrames result different from other packages

Open 3210jr opened this issue 1 year ago • 2 comments

Hey @jiro4989, thanks for the awesome package!

This might be a skill issue or a misunderstanding on my part, but the outputs of wav.readFrames looks like this:

@[126, 0, 126, 0, 118, 0, 112, 0, 121, 0, 125, 0, 118, 0, 118, 0, 123, 0, 126, 0, 117]

While the output from scipy.io's wavfile package looks like this:

array([ 126,  126,  118,  112,  121,  125,  118,  118,  123,  126,  117,
        116,  118,  103,  100,  112,  111,  101,  106,  117,  115,  125])

It seems like the values are the same only that the nim version has "0"'s in between the values. This continues up to around the 400th frame and the results no longer match at all.

I am using: nim v2.0

The wave file I'm reading has the following metadata:

(riffChunkDescriptor: (id: "RIFF", size: 12503872, format: "WAVE"), formatSubChunk: (id: "fmt ", size: 16, format: 1, numChannels: 1, sampleRate: 44100, byteRate: 88200, blockAlign: 2, bitsPerSample: 16, extendedSize: 0, extended: @[]), dataSubChunk: (id: "data", size: 12503636, data: ...), factSubChunk: nil, audioStartPos: 44)

Is there some more information that you need?

Thanks again!

3210jr avatar Oct 08 '23 18:10 3210jr