- Home /
Small Sound File Import - Results in 40+/mb File Size!
Currently I'm trying to simply import a very basic sound file into my Unity Project, and it's apparently harder than it sounds. As displayed in the images below, the short three-four minute sound file is a total of less than ten megabytes on its own.
However upon inserting it into Unity, the file size jumps up to a staggering 40.3MB for this single file-- more than four times what the size actually is. I've fiddled around with every compression format and sample rate setting, and the only way to get the file size down is to force-lower the sample rate. Even then, the only possible way to get it anywhere near it's original size is to lower it to an astonishingly-bad and completely unacceptable 8k HZ.
In-Unity File Size (After Import)
If someone could please explain what is happening here and perhaps suggest a fix, I'd be overjoyed. Thanks everyone.
Answer by zach-r-d · Jul 30, 2015 at 10:31 PM
What's happening is that the current import settings are converting the highly-compressed mp3 audio to ADPCM audio, which is still compressed but not nearly as much, so taking up 4x the space makes sense. Of course, the extra audio quality that the extra space allows support for is wasted when up-converting from mp3. PCM is completely uncompressed and thus can support maximum quality, but takes up a huge amount of space.
In this case, the solution is to use the Vorbis compression format (comparable to mp3, some say it's better). I just tested it with a 3.5 minute 320kbps mp3, and with import settings set to Vorbis with quality 100 and sample rate set to Preserve, it came out to a little under 75% the original size.
Thank you for trying, but no cigar. Reference Image
I had already tried Vorbis and PC$$anonymous$$, ADPC$$anonymous$$ was just what I left it on during that screenshot. As you can see above, there was no change to the file size after following your instructions. (You can tell it's been applied, as the Apply button is greyed out.) I fiddled with the Quality slider and while it recompressed it, it made no change to the file size even at 1% quality. I also tried Optimize ins$$anonymous$$d of Preserve, still nothing. The only time a file size change reflects in the editor, is when forcing the sample rate to a ridiculously low sample rate-- and even then the file size is ridiculous.
Edit: I'd also like to add that I'm on the latest stable build of Unity 5.
That screenshot says 8321088 bytes, which is 8.3$$anonymous$$B. It's a whole digit less than the first screenshot. Do I get the cigar now? :P