Usages of

android.media.audiofx.NoiseSuppressor.setEnabled(?)
protected NoiseSuppressor noiseSuppressor; // code omitted ... 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 NoiseSuppressor suppressor; // code omitted ... public void setSuppressor(boolean b) { try { suppressor.setEnabled(b); }catch (Exception e){ e.printStackTrace(); } }
private NoiseSuppressor noiseSuppressor = null; // code omitted ... 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"); } }
NoiseSuppressor mNoiseSuppressor; //��������������������� // code omitted ... /** * ��������������������� * @param enable */ private void setNoiseSuppressor(boolean enable){ if (mNoiseSuppressor == null){ mNoiseSuppressor = NoiseSuppressor.create(mMediaPlayer.getAudioSessionId()); mNoiseSuppressor.setEnabled(enable); } }
public VoiceActivityRecognizer(AudioRecord audioRecord) { this.audioRecord = audioRecord; this.audioBufferSize = (int) Math.pow(2,Math.round(Math.log(audioRecord.getSampleRate()/50)/Math.log(2))); if (NoiseSuppressor.isAvailable()) { NoiseSuppressor noiseSuppressor = NoiseSuppressor.create(audioRecord.getAudioSessionId()); if(noiseSuppressor != null && !noiseSuppressor.getEnabled()) { noiseSuppressor.setEnabled(true); } } }
private NoiseCheckTask(NoiseTracker noiseTracker) { audioRecorder = new AudioRecord(MediaRecorder.AudioSource.CAMCORDER, SAMPLING, AudioFormat.CHANNEL_IN_MONO, AudioFormat.ENCODING_PCM_16BIT, bufferSize); if (NoiseSuppressor.isAvailable()) { NoiseSuppressor noiseSuppressor = NoiseSuppressor.create(audioRecorder.getAudioSessionId()); if (noiseSuppressor == null) FirebaseCrash.report(new Throwable("noise suppressor is null when it should be available.")); else if (!noiseSuppressor.getEnabled()) noiseSuppressor.setEnabled(true); } this.noiseTracker = noiseTracker; }
@SuppressLint("NewApi") public void enableNoiseSuppressor() { if (!NoiseSuppressor.isAvailable()) { Log.e("AudioProcessor", "NoiseSuppressor is not supported in this device!"); } else { NoiseSuppressor noiseSuppressor = NoiseSuppressor.create(mAudioRecorder.getAudioSessionId()); if (!noiseSuppressor.getEnabled()) { noiseSuppressor.setEnabled(true); Log.i(LOG_TAG, "NoiseSuppressor is enabled!"); } else { Log.i(LOG_TAG, "NoiseSupporessor is already enabled!"); } } }
@TargetApi(Build.VERSION_CODES.JELLY_BEAN) public static void aec(AudioRecord ar) { if (AcousticEchoCanceler.isAvailable()) { AcousticEchoCanceler aec = AcousticEchoCanceler.create(ar.getAudioSessionId()); if (aec != null && !aec.getEnabled()) { aec.setEnabled(true); } } if (NoiseSuppressor.isAvailable()) { NoiseSuppressor noise = NoiseSuppressor.create(ar.getAudioSessionId()); if (noise != null && !noise.getEnabled()) { noise.setEnabled(true); } } }
public static void aec(AudioRecord ar) { if (AcousticEchoCanceler.isAvailable()) { AcousticEchoCanceler aec = AcousticEchoCanceler.create(ar.getAudioSessionId()); if (aec != null && !aec.getEnabled()) { aec.setEnabled(true); } } if (NoiseSuppressor.isAvailable()) { NoiseSuppressor noise = NoiseSuppressor.create(ar.getAudioSessionId()); if (noise != null && !noise.getEnabled()) { noise.setEnabled(true); } } }
Usage snippet has been bookmarked! Review your bookmarks
Thank you! Review your likes