|
32 | 32 | import android.widget.BaseAdapter; |
33 | 33 | import android.widget.LinearLayout; |
34 | 34 | import android.media.audiofx.AudioEffect; |
| 35 | + |
35 | 36 | import java.util.UUID; |
36 | 37 |
|
37 | 38 | public class EffectsTest extends Activity { |
@@ -154,13 +155,35 @@ public EffectView(Context context, AudioEffect.Descriptor[] descriptors) { |
154 | 155 | this.setOrientation(VERTICAL); |
155 | 156 | } |
156 | 157 |
|
| 158 | + public String effectUuidToString(UUID effectType) { |
| 159 | + if (effectType.equals(AudioEffect.EFFECT_TYPE_VIRTUALIZER)) { |
| 160 | + return "Virtualizer"; |
| 161 | + } else if (effectType.equals(AudioEffect.EFFECT_TYPE_ENV_REVERB)){ |
| 162 | + return "Reverb"; |
| 163 | + } else if (effectType.equals(AudioEffect.EFFECT_TYPE_PRESET_REVERB)){ |
| 164 | + return "Preset Reverb"; |
| 165 | + } else if (effectType.equals(AudioEffect.EFFECT_TYPE_EQUALIZER)){ |
| 166 | + return "Equalizer"; |
| 167 | + } else if (effectType.equals(AudioEffect.EFFECT_TYPE_BASS_BOOST)){ |
| 168 | + return "Bass Boost"; |
| 169 | + } else if (effectType.equals(AudioEffect.EFFECT_TYPE_AGC)){ |
| 170 | + return "Automatic Gain Control"; |
| 171 | + } else if (effectType.equals(AudioEffect.EFFECT_TYPE_AEC)){ |
| 172 | + return "Acoustic Echo Canceler"; |
| 173 | + } else if (effectType.equals(AudioEffect.EFFECT_TYPE_NS)){ |
| 174 | + return "Noise Suppressor"; |
| 175 | + } |
| 176 | + |
| 177 | + return effectType.toString(); |
| 178 | + } |
| 179 | + |
157 | 180 | public void set(int position) { |
158 | 181 | TextView tv = new TextView(mContext); |
159 | 182 | tv.setText("Effect "+ position); |
160 | 183 | addView(tv, new LinearLayout.LayoutParams( |
161 | 184 | LayoutParams.MATCH_PARENT, LayoutParams.WRAP_CONTENT)); |
162 | 185 | tv = new TextView(mContext); |
163 | | - tv.setText(" type: "+ mDescriptors[position].type.toString()); |
| 186 | + tv.setText(" type: "+ effectUuidToString(mDescriptors[position].type)); |
164 | 187 | addView(tv, new LinearLayout.LayoutParams( |
165 | 188 | LayoutParams.MATCH_PARENT, LayoutParams.WRAP_CONTENT)); |
166 | 189 | tv = new TextView(mContext); |
|
0 commit comments