I have a 2 seconds 16bit single channel 8khz wav file and I need to change its volume.
It should be quite straightforward, because changing the volume is the same as
As you can see in the comments of the question, there are several solutions, some more efficient.
The problem was immediately detected by Jan Dvorak ("the * 5 part is clipping and overflowing") and the straightforward solution was:
s = numpy.fromstring(s, numpy.int16) / 10 * 5
In this case, this solution was perfect for me, just good enough.
Thank you all folks!