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: Why do you think that is wrong? And what would you do instead? I don't want to divide by 32767 as then you have values that go over 1.0, which may get clipped unneccessarily depending on what goes on later in your pipeline. And I certainly don't want an input sample of 0 to convert to anything other than 0.0, or it will introduce some dc offset.

Viewing all articles
Browse latest Browse all 738

Trending Articles



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