Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Appropriate audio format for sound effects on Android phones regarding efficiency

I profiled my programs, and it turned out a large portion of CPU was spent on SoundPool.play().

The game has ~10 sound files, each under 1 second. Currently they are 64kbs variable MP3s. They are loaded to a SoundPool at the beginning and played frequently throughout the game.

My question: What audio format (e.g. mp3, ogg, etc.) is most friendly to cpu and battery consumption on mobile devices? I use them only for sound effects, and there's no need for simultaneous playbacks.

Many thanks.

like image 415
Phil Avatar asked Mar 20 '11 04:03

Phil


People also ask

Which audio format is best for Android?

Advanced Audio Coding, or AAC files (also known as MPEG-4 AAC), take up very little space and are good for streaming, especially over mobile devices. Requiring less than 1 MB per minute of music and sounding better than MP3 at the same bitrate, the AAC format is used by iTunes/Apple Music, YouTube, and Android.

Which audio format has the best quality?

A lossless audio file format is the best format for sound quality. These include FLAC, WAV, or AIFF. These types of files are considered “hi-res” because they are better or equal to CD-quality. The tradeoff is that these files will be very large.

What sound file does Android use?

MP3 is the most commonly used format for audio, songs, and ringtones, but it's not the only one. Android all supports M4A, WAV, and OGG.

What is audio effects on Android phone?

Introduction to Android Audio Effects Audio effects are used to enhance audibility of sound or to improve a specific audio feature. Android source code comes with few default audio effects like bassboost, equalizer, loudness enhancer which are then applied to the track using AudioFlinger while playing audio.


1 Answers

As far as I know, there will be not much difference, as Android uncompresses the audio files before putting them into the SoundPool, in order to be able to quickly play them afterwards. That's also the reason that you cannot put very many (or large) sounds into a sound pool without running out of memory.

like image 114
Ridcully Avatar answered Sep 23 '22 13:09

Ridcully