Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Android audio effect limits to 5 bands

I use Android Audio Effect/Equalizer API for my app. However, it limits to 5 bands. Is there any document/library that helps to tune more bands for a finer equalizer implementation?

like image 765
Bao Le Avatar asked Sep 22 '12 16:09

Bao Le


People also ask

What is audio effects on my Android phone?

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.


2 Answers

It varies from device to device getNumberOfBands tell you the number of Equalizer effect. Some devices have 5,8 and 13,etc.

Equalizer equalizer = new Equalizer(0,mediaplayer.getAudioSessionId());

equalizer.setEnabled(true);

equalizer.getNumberOfBands(); //it tells you the number of equalizer in device.

Also have a look at this

like image 192
Zar E Ahmer Avatar answered Sep 27 '22 17:09

Zar E Ahmer


This question was asked long ago. Here is a solution for people seeking answer in future. I have found this library for android that provides 10band Equalizer.

Using Android's Equalizer Api on three different devices I was able to get the following result:

1) Samsung Galaxy Note 3 (5 Bands)

2) Huawei Mate 8 (5 Bands)

3) Nexus 5 (5 bands)

using this library I am able to get 10bands on all of the above devices. I have tested it and it is working great.

Include this library in your project. And use the following code to have an Equalizer with 10 bands.

IMediaPlayerFactory mediaPlayerFactory = new OpenSLMediaPlayerFactory(getApplicationContext());
IBasicMediaPlayer mediaPlayer = mediaPlayerFactory.createMediaPlayer();
IEqualizer equalizer = mediaPlayerFactory.createHQEqualizer();
/* This returns 10 bands exactly like Poweramp music app does */
int numOfBands = equalizer.getNumberOfBands();

This library has is documentation that you can refer as-well. Hope this helps.

like image 38
Shoaib Anwar Avatar answered Sep 27 '22 16:09

Shoaib Anwar