I have an audio wave already established. I want to normalize it or have the value control from -1 to +1 in the sample editor.

Does anyone have information of what mathematical formula or what procedure should I do to solve these operations?

At the moment, I know how to get the maximum positive and negative value. Therefore, with a subtraction I have the maximization value.

But how do you maximize a wave? Maximize allows you to preserve the wave pattern, but larger. It is not the same as styling it up and down.

The API gives us access to the position of the frames and the value of the sample between -1 and +1. By iteration it is possible to modify all the points as you like.

I know that with a simple sum I am stretching the wave, but this is not maximizing.

Yes, I have all this already present. Not only is there the maximum positive and negative value, but they are two audio waves if they are stereo. It’s time to compare 4 numbers.

I will try to find the fastest way. If multiplication is appropriate, I will apply it like this, that is, iterate all the frames multiplying the x value by the value of each sample.