What might be interesting to try instead is to manipulate the global_gain value for each of the two granules in each frame. Since this is a constant-width field in the frame's side information, modifying it would be trivial.
Now we're talking!
You seem to really know your stuff. Can you help give me some specifications as to how I might be able to locate these bytes in a standard 128kbps 44khz MP3 file? Are they part of the frame header? I've already got some code that dissects the frame header a little bit and performs some simple operations based on it. I'd love to experiment with it and see what I can come up with.
However, you would still need to decode the entire stream to determine an appropriate scaling factor.
Yes, of course. If you wanted to go to that kind of trouble. Although a simpler program could just allow you to manually enter the scaling factor, then preview your changes by ear.
If it worked at all, anyway...
Another option it seems to me is rather than modify the audio stream itself, modify the decoder to perform the scaling in real time while the audio is playing. This assumes the player can know in advance by what factor to scale, but people have talked about some ways to accomplish this.
Exactly. As I've said before, a playback-only normalizer sounds technically feasible (but not easy).