Open HelgeStenstrom opened 5 years ago
I think you have to multiply with 100 or divide by 100 ? It's been time i wrote it . Maybe it's a bug too , in XR3Player it works quite well .
No, you have to do a conversion between linear scale and logarithmic (dB) scale. Since the setter method name and the getter method name don't match, there is an opportunity to simply add another method, with matching name and matching gain scale.
https://github.com/goxr3plus/java-stream-player/blob/ea4b7d9fda27f81902a0774a2535842ead6c622a/src/main/java/com/goxr3plus/streamplayer/stream/StreamPlayer.java#L1096-L1099
At least it doesn't return the value set by setGain(), which is confusing. After reading the code, I realize that the internal gainControl probably has a setting on a dB scale, whereas setGain is linear.
getGainValue() doesn't translate from the gainControl setting, but setGain() does, which leads to the confusion.