Surprisingly, there’s simply no way to do this, it’s just how Unity is.
It’s a case of, every single audio engineer who works on a Unity project for the first time, is shocked to learn this!
The internal paradigm of Unity per their
AudioClip import concept is that upon import it completely expands the sound first, and then compresses it according to a couple of choices you have (depending on the version of Unity), and a slider. It’s then saved internally … to be used for the actual shipped product.
To “adjust the compression” of audio clips in Unity, it literally just comes down to the programmer setting a slider - that is literally and absolutely the only choice you have!
So, after building the project the producers or whoever will say “ok, the final build could be a bit bigger so let’s increase the sound quality” or “we’ll have to compress the sound a bit to make the build a bit smaller” - and it’s literally just a case of moving that slider.
Again regarding the audio files you “drop in” to Unity, there is absolutely literally no point doing anything to them - just drop in the full-size totally uncompressed versions.
(Careful audio engineers sometimes care for even the frames of the audio files, so that frames end clean and stuff - this is absolutely pointless when sending to a Unity project as Unity just unpacks them and recompresses/packs as it sees fit!)
Note that Unity tend to noodle with the formats it uses (“compresses to” if you will) each new version, you can usually see the details here or on their change logs Unity - Manual: Audio Clip Again as the audio engineer all you can really do is tell the programmers “please choose XYZ compression” (from the list there) and “set the slider to 48%” - !
BTW note this point … you simply cannot loop mp3s in Unity, if you have to loop, instead just send over wav or whatever.
To be absolutely clear,
Is there anyway to tell Unity to use the file the way it is and to leave it alone and not recompress it?
(i) there is NOT any such button in Unity (ii) it’s not conceptually possible based on how Unity works: every audio file is taken apart by Unity and “handled” by the Unity pipeline entirely; it does not, at all, “use what you give it”. In contrast with say PNG assets it actually “uses the binary data you give it”; this is just not the case with audio assets (much to the surprise of audio engineers everywhere!)