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

Commented Issue: drumsamplepatternprovider array clear [16362]

$
0
0
In this section of Read:

if (samplesRead < count)
{
Array.Clear(buffer, offset + samplesRead, count - samplesRead);
samplesRead = count;
}

buffer is being Cleared as a byte[] at runtime, but the next 2 parameters are sample based (ie off by factor of 4).

Read parameter signature is a float[] so this does confuse me a bit. i worked around by ()*4 the 2nd 2 params.
Comments: good spot, the WaveBuffer hack confuses Array.Clear, so it isn't really safe to use in this fuction. I'll replace it with a for loop setting the values to 0.

Viewing all articles
Browse latest Browse all 738

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>