I'm trying to imagine a way to change the volume of a PCM stream without the use of floating point numbers, to be able to do the job on simple dedicated hardware. I found very interesting this thread: How to change the volume of a PCM data stream (failed experiment) But they use floating point numbers.
Now, PCM samples are signed int, so if I would sum or subtract a value to the samples, I have to increase or decrease the absolute value, otherwise I'm just shifting the wave up or down. More, I have to be sure that the positive samples does not become negative and vice versa (because they may be smaller than the value I'm subtracting). In this case the value of the sample should stop on 0.
So, the question: is this approach correct? have I to expect any quality loss?
Thanks.