Make S16 to F32 sample conversion less magical

This commit is contained in:
Roderick van Domburg 2021-03-27 21:42:10 +01:00
parent bfca1ec15e
commit cdbce21e71

View file

@ -45,7 +45,7 @@ where
packet
.data
.iter()
.map(|sample| ((*sample as f64 + 0.5) / (0x7FFF as f64 + 0.5)) as f32)
.map(|sample| ((*sample as f64 + 0.5) / (std::i16::MAX as f64 + 0.5)) as f32)
.collect(),
)));
}