Usages of

android.media.audiofx.NoiseSuppressor.isAvailable()
public void setNoise(boolean bl) { if (NoiseSuppressor.isAvailable()) { noiseSuppressor.setEnabled(bl); } else { Toast.makeText(context, noNoiseSuppressor, Toast.LENGTH_SHORT).show(); } }
public static void enableNS(int sessionId) { if (NoiseSuppressor.isAvailable()) { NoiseSuppressor ns = NoiseSuppressor.create(sessionId); if (ns != null) ns.setEnabled(true); } }
private void checkthingsforrecoder() { int audioSessionId = getAudioSessionId(); if(NoiseSuppressor.isAvailable()) { // NoiseSuppressor.create(audioSessionId); } if(AutomaticGainControl.isAvailable()) { // AutomaticGainControl.create(audioSessionId); } if(AcousticEchoCanceler.isAvailable()){ // AcousticEchoCanceler.create(audioSessionId); } }
public void enableNoiseSuppressor() { if (NoiseSuppressor.isAvailable() && noiseSuppressor == null) { noiseSuppressor = NoiseSuppressor.create(microphoneId); noiseSuppressor.setEnabled(true); Log.i(TAG, "NoiseSuppressor enabled"); } else { Log.e(TAG, "This device don't support NoiseSuppressor"); } }
public static boolean isNoiseSuppressorAvailable() { if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.JELLY_BEAN) { return NoiseSuppressor.isAvailable(); } return false; }
@Override public void run() { minBufferSize = AudioRecord.getMinBufferSize(SAMPLE_RATE, CHANNEL, FORMAT); AudioRecord record = new AudioRecord(AUDIO_SOURCE, SAMPLE_RATE, CHANNEL, FORMAT, minBufferSize); if(NoiseSuppressor.isAvailable()) { NoiseSuppressor.create(record.getAudioSessionId()); } //System.out.println(NoiseSuppressor.isAvailable()); record.startRecording(); writeToFile(minBufferSize, record); }
private void updateStatus() { String status = ""; boolean isAECAvailable = AcousticEchoCanceler.isAvailable(); boolean isNSAvailable = NoiseSuppressor.isAvailable(); boolean isAGCAvailable = AutomaticGainControl.isAvailable(); status = "NS: " + (isNSAvailable == true ? "A" : "N/A") + " "; status += "AEC: " + (isAECAvailable == true? "A" : "N/A") + " "; status += "AGC: " + (isAGCAvailable == true? "A" : "N/A"); tv_status.setText(status); }
//Test case 1.1: test NS creation and release public void test1_1NsCreateAndRelease() throws Exception { AudioRecord ar = getAudioRecord(); assertNotNull("could not create AudioRecord", ar); boolean isAvailable = NoiseSuppressor.isAvailable(); NoiseSuppressor ns = NoiseSuppressor.create(ar.getAudioSessionId()); assertTrue("NS not available but created or available and not created", isAvailable == (ns != null)); if (ns != null) { ns.release(); } ar.release(); }
public static boolean e() { boolean z = false; if (VERSION.SDK_INT >= 16) { try { z = NoiseSuppressor.isAvailable(); } catch (Throwable th) { Log.a(th); } } return z; }
@Override public void onCheckedChanged(CompoundButton compoundButton, boolean b) { try { if (NoiseSuppressor.isAvailable()) { playService.setSuppressor(b); } else { Toast.makeText(EqualizerActivity.this, "���������������������������������", Toast.LENGTH_SHORT).show(); suppressor.setChecked(false); } }catch (Exception e){ e.printStackTrace(); } }
Usage snippet has been bookmarked! Review your bookmarks
Thank you! Review your likes