malsackj said:
So this would be also very true for a file that is compressed. That would bring back the dynamics and actual recording. But this would be changing the balance of instruments also. Sometimes the compressed sounds is to limit the dynamics to provide the sounds and levels the producer is looking for.
I assume you are referring to dynamically compressed audio. In general, no, it is VERY difficult to restore the exact dynamic range of audio which has been compressed.
Why?
Well... imagine it like this... most dynamic compression in recording studios is done with compressors that are generally tuned to compression ratios of 2:1 up to 20:1. If there is a compression ratio of, say, 5:1 applied to a file, then how do you know what levels to restore everything to with decompressing?
If you have a reference level for the original file available and the exact same algorithms being applied in reverse, you might get close to the original, but who has all those things? There are a million different means for compressing and decompressing audio dynamics, and without knowledge of the original signal, how can you determine how to be accurate?
Examples of compression and decompression exist in our audio past! Look at Dolby noise reduction. It took used a frequency filter to compress only the high frequency content prior to recording to tape, then used an identical filter and expander to "uncompress" the treble on playback. It didn't work perfectly, but the improvement in noise issues tended to outweigh the artifacts of the compression/decompression process. DBX took it to the extreme with mixed results. Ultimately, most serious audio nuts didn't bother with it, choosing to deal with the noise issues rather than the dynamics issues.
So, let's do an exercise in compression and decompression. Let's pretend we have a signal with 100 levels of dynamic range. If we compress that signal by a ratio of 2:1, the resulting signal will have 50 levels of range. that means every "sample" will either be rounded up or rounded down to fit into the new 50 points of dynamic range. To decompress, how do you know if any given level should be higher or lower than the point it is now? What if it needs to stay the same? That's three distinct possible level changes - move up, move down, or keep the same.
So, if you have a compressed signal which goes from 33 to 34 to 35 to 35 to 36 to 35... do the decompressed samples 66 to 68 to 70 to 70 to 72 to 70? Or, do they convert to 65, 68, 70, 71, 72, and 71? There are hundreds of possibilities. Now imagine that with 16 bits of dynamic range and a more common compression ratio of 5:1 or 10:1. It would be impossible.
With tons of care and an expert doing the work with painstaking attention to detail, you can get really good results. But to do it on the fly in a processor or PC for a consumer product, I doubt that is possible without a reference from the original studio work.