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

Commented Issue: Conversion to Float is wrong [16380]

$
0
0
This code is from SimpleCompressorStream there is the followig code
left = BitConverter.ToInt16(buffer, start) / 32768.0;

that is wrong because max short is 32767 while min short is -32768

the resulting code will span ranges from[-1 to 0.99999999999999999]
Comments: If you are interested in an explanation of why the range of values for floating point is -1 to 0.9999 then there is one in Will Pirkle's book "Designing Audio Effect Plug-Ins in C++"

Viewing all articles
Browse latest Browse all 738

Trending Articles



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