- Home /
Is it efficient to use .mp3, rather than using .wav?
Run time memory perspective, which format is effective (.mp3 or .wav).?
$$anonymous$$y understanding was that it all gets compressed into a platform specific format anyway? But I could be wrong
Answer by senc01a · Aug 19, 2014 at 11:44 AM
Mp3 is compressed, as opposed to Wav which is (generally speaking) raw Data. Wav uses more memory, but mp3 requires more processing power. Its an interesting trade-off, although as most devices have built-in mp3 and mp4 hardware decoder, I believe that using mp3 is a better solution. This is in general applicable for music, as for general sounds (interface and so on), perhaps it is better to use wav.
So generally speaking I believe that the best practices are:
Mp3 for long sound files (Music and ambient sounds)
Wav for small sound files (Interface and game sounds)
You can find additional discussion on the topic in the following links:
Thank you for the answer. But, from my observation by running the profiler
1 $$anonymous$$B of .wav file is equal to around 0.4 $$anonymous$$B of .mp3 file. But, we know the compression (encoding) is better than .mp3. And, during the run time of the game, .mp3 file take more run time memory than .wav. Because of decoding of .mp3 (.mp3 is compressed & .wav is uncompressed).
Answer by Rouge Digital · Jul 03, 2016 at 09:44 PM
for efficiency I would recommend you look at a rolling buffer so you dont have to keep the full music file in memory.
I maid an Asset to do just this, it works on Win, Max, Linux, iOS, android...
Asset - uAudio: Mp3 Player/Streamer
Answer by Kreathe · Aug 18, 2017 at 10:00 AM
first, let's take a look at several formats, source from: https://www.lifewire.com/different-types-of-music-files-3134920 MP3: Designed by the Moving Pictures Experts Group (MPEG), an organization that develops standards for coded audio and video programs, the MPEG-1/MPEG-2 Layer 3 (MP3) is arguably the most prolific and supported audio file type. MP3 is both a compressed and lossy audio format, with bit rates ranging from 8 kbit/s up to a maximum of 320 kbit/s, and sampling frequencies ranging from 16 kHz to a maximum of 48 kHz. The smaller file sizes of MP3s means faster file transferring and less space used, but at the cost of a reduction in sound quality (versus lossless). WAV: Also developed by Microsoft, the Waveform Audio File Format (WAVE, or more commonly known as WAV) is a standard for Windows-based systems and compatible with a variety of software applications. WAV is both an uncompressed (but can also be coded as compressed) and lossless audio format, essentially an exact copy of the source data. Individual files can take up a significant amount of space, making the format more ideal for archiving and/or audio editing. WAV audio files are similar to PCM and AIFF audio files. But if I were you, I will convert them freely and choose the best one I like, http://www.videoconverterfactory.com/tips/m4a-to-wav.html I am usually using wav format for high quality. cheers
Your answer
Follow this Question
Related Questions
Converting .wav to .mp3 0 Answers
Best Audio File Format Practices? iOS/Unity 1 Answer
Load MP3 file in code 0 Answers
Ambisonic Audio working on PC but not Android 3 Answers
MP3 to OGG Converter, Plugin, Command Line to be used with Unity 1 Answer