Quantcast
Channel: naudio Work Item Rss Feed
Viewing all articles
Browse latest Browse all 738

Commented Issue: WaveFileChunkReader.ReadWaveHeader assumes that the stream supports position/seek [16354]

$
0
0
I am using this class to read a wave stream but the derived stream class that I am using that contains the wave does not support setting the Postion (CanSeek == false).
public void ReadWaveHeader(Stream stream)
{ ...
while (stream.Position <= stopPosition - 8)
{...
stream.Position += chunkLength; //This line throws an expection.
}
...
}
Is it posible to use another metholody to read the wave that is not based on Postion? or is there another alternative?
Comments: By the way I think that : ``` stream.Position += chunkLength; ``` should really be : ``` stream.Position += ((chunkLength % 2 == 1) ? (chunkLength + 1) : chunkLength); ``` (both occurrences in this file) Given that 1 padding byte sometimes has to be skipped (chunks with an odd "specified" length L, actual length is L + 1 !) Will fix this when ... I understand how to submit a fix on Codeplex !

Viewing all articles
Browse latest Browse all 738

Trending Articles