This has probably nothing to do with [Issue 24](https://nvorbis.codeplex.com/workitem/24) since the provided ogg file decodes properly now. I have, however, experienced problems with another ogg file.
There is some noticeable "clicking" noise in the beginning, which appears to be the result of decode errors in the first 256 samples. I get values around +/- 30000 which is definitely incorrect. When opening the same file with Audacity, the first samples have regular values close to zero.
Comments: Yep, the floor calculation wasn't clearing the residue when no floor energy is defined. In VorbisFloor.cs, look for Floor1.Apply(PacketData, float[]) and change the body to: ``` var data = packetData as PacketData1; if (data == null) throw new InvalidDataException("Incorrect packet data!"); var n = data.BlockSize / 2; if (data.PostCount > 0) { var stepFlags = UnwrapPosts(data); var lx = 0; var ly = data.Posts[0] * _multiplier; for (int i = 1; i < data.PostCount; i++) { var idx = _sortIdx[i]; if (stepFlags[idx]) { var hx = _xList[idx]; var hy = data.Posts[idx] * _multiplier; if (lx < n) RenderLineMulti(lx, ly, Math.Min(hx, n), hy, residue); lx = hx; ly = hy; } if (lx >= n) break; } if (lx < n) { RenderLineMulti(lx, ly, n, ly, residue); } } else { Array.Clear(residue, 0, n); } ``` I combined steps with some of more optimizations, and in this case forgot to do the "matrix multiply" with an empty floor if no floor energy is defined. I'll get a bugfix release posted when I get a chance. Thanks for catching this one!
There is some noticeable "clicking" noise in the beginning, which appears to be the result of decode errors in the first 256 samples. I get values around +/- 30000 which is definitely incorrect. When opening the same file with Audacity, the first samples have regular values close to zero.
Comments: Yep, the floor calculation wasn't clearing the residue when no floor energy is defined. In VorbisFloor.cs, look for Floor1.Apply(PacketData, float[]) and change the body to: ``` var data = packetData as PacketData1; if (data == null) throw new InvalidDataException("Incorrect packet data!"); var n = data.BlockSize / 2; if (data.PostCount > 0) { var stepFlags = UnwrapPosts(data); var lx = 0; var ly = data.Posts[0] * _multiplier; for (int i = 1; i < data.PostCount; i++) { var idx = _sortIdx[i]; if (stepFlags[idx]) { var hx = _xList[idx]; var hy = data.Posts[idx] * _multiplier; if (lx < n) RenderLineMulti(lx, ly, Math.Min(hx, n), hy, residue); lx = hx; ly = hy; } if (lx >= n) break; } if (lx < n) { RenderLineMulti(lx, ly, n, ly, residue); } } else { Array.Clear(residue, 0, n); } ``` I combined steps with some of more optimizations, and in this case forgot to do the "matrix multiply" with an empty floor if no floor energy is defined. I'll get a bugfix release posted when I get a chance. Thanks for catching this one!