For mp3 players for Android and vav

I want to know whether it is faster to download and play a small wav than a small mp3 file on an Android media player. WAVs are about 30 KB, and the same files as mp3 are about 20 KB. MP3s have the advantage of saving resource space. Sound files should be played in a split second.

+4
source share
4 answers

For such small sounds, you get the best results with SoundPool .

+2
source

Even the weakest Android devices have enough processing power to play mp3s and probably also have hardware acceleration. The real question is the installation overhead for playing wav versus playing mp3, which should be fairly easy to measure programmatically.

I am a little surprised that you get such a low compression ratio with mp3. Even lossless compression algorithms have a 2: 1 compression ratio with wav. Given that the Android device is probably not connected to speakers with audiophile quality, you can get away with the mono-compression of an mp3 player with a bandwidth of 64 kbps or even lower. If you can get the file size under 4K, it will fit on one page of memory, which is about as low as you can get for the OS overhead.

If for any reason you are stuck with a compression ratio of 1.5: 1, this is probably not worth the extra work.

+1
source

Wav files use more space because they have a higher sampling rate. Quite a lot indicates that the sound wave will be traced, so theoretically more computing power is needed to play wav. Also, the wave is uncompressed, which means that it has all the information from the source from which it was taken. When you take a CD and convert it to wav, you more or less have a copy of the original. When you convert to mp3, it uses fewer reference points, and the details are lost. Secondly, most mp3 encoders normalize music, which is a fancy way of saying that it makes quiet parts louder and loud parts quieter. All this says that some people cannot hear the difference, and this mainly depends on what types of headphones / speakers you are listening to ... ALLL, which, as they say, should not be delayed in any format, the only difference should be the frequency discretization or "resolution" of the sound file

+1
source

I do not have the technical “material” to support me here, but since no one else has cracked it, I will do it.

I know mp3s have "better" compression than wavs, so the file is smaller. This would mean, however, that more processors would be needed to “unzip” the files. (This can be done on specialized equipment, so this can be a contentious issue.) In addition, since the files will be overpriced, it can be tricking to see the size of the mp3 file is smaller and to think that it will load and play faster.

Given the history of the wav file format and that it serves as the “lowest common denominator” when it comes to exchanging audio files between different programs (behind Wikipedia ), I would make a reasonable assumption that it is faster to download and play a small wav file. It really depends on the implementation of the Android software libraries, as well as the hardware, so if someone knows more, it would be great to hear their opinion.

0
source

Source: https://habr.com/ru/post/1313982/


All Articles