create用法java_Java AcousticEchoCanceler.create方法代碼示例
import android.media.audiofx.AcousticEchoCanceler; //導入方法依賴的package包/類
@Override
public boolean initCapturer() {
// initalize audio mode
audioManagerMode.acquireMode(audioManager);
// get the minimum buffer size that can be used
int minRecBufSize = AudioRecord.getMinBufferSize(
captureSettings.getSampleRate(),
NUM_CHANNELS_CAPTURING == 1 ? AudioFormat.CHANNEL_IN_MONO : AudioFormat.CHANNEL_IN_STEREO,
AudioFormat.ENCODING_PCM_16BIT
);
// double size to be more safe
int recBufSize = minRecBufSize * 2;
// release the object
if (noiseSuppressor != null) {
noiseSuppressor.release();
noiseSuppressor = null;
}
if (echoCanceler != null) {
echoCanceler.release();
echoCanceler = null;
}
if (audioRecord != null) {
audioRecord.release();
audioRecord = null;
}
try {
audioRecord = new AudioRecord(AudioSource.VOICE_COMMUNICATION,
captureSettings.getSampleRate(),
NUM_CHANNELS_CAPTURING == 1 ? AudioFormat.CHANNEL_IN_MONO
: AudioFormat.CHANNEL_IN_STEREO,
AudioFormat.ENCODING_PCM_16BIT, recBufSize);
if (NoiseSuppressor.isAvailable()) {
noiseSuppressor = NoiseSuppressor.create(audioRecord.getAudioSessionId());
}
if (AcousticEchoCanceler.isAvailable()) {
echoCanceler = AcousticEchoCanceler.create(audioRecord.getAudioSessionId());
}
} catch (Exception e) {
throw new RuntimeException(e.getMessage());
}
// check that the audioRecord is ready to be used
if (audioRecord.getState() != AudioRecord.STATE_INITIALIZED) {
throw new RuntimeException("Audio capture is not initialized " + captureSettings.getSampleRate());
}
shutdownCaptureThread = false;
new Thread(captureThread).start();
return true;
}
create用法java_Java AcousticEchoCanceler.create方法代碼示例相关推荐
- newinsets用法java_Java XYPlot.setInsets方法代碼示例
import org.jfree.chart.plot.XYPlot; //導入方法依賴的package包/類 public static void setTimeSeriesRender(Plot ...
- rowdata java_Java RowDataUtil.addRowData方法代碼示例
本文整理匯總了Java中org.pentaho.di.core.row.RowDataUtil.addRowData方法的典型用法代碼示例.如果您正苦於以下問題:Java RowDataUtil.ad ...
- drawlinetest.java_Java Graphics2D.setRenderingHint方法代碼示例
本文整理匯總了Java中java.awt.Graphics2D.setRenderingHint方法的典型用法代碼示例.如果您正苦於以下問題:Java Graphics2D.setRenderingH ...
- bls java_Java PairingFactory.getPairing方法代碼示例
本文整理匯總了Java中it.unisa.dia.gas.plaf.jpbc.pairing.PairingFactory.getPairing方法的典型用法代碼示例.如果您正苦於以下問題:Java ...
- isdisposed java_Java Shell.isDisposed方法代碼示例
本文整理匯總了Java中org.eclipse.swt.widgets.Shell.isDisposed方法的典型用法代碼示例.如果您正苦於以下問題:Java Shell.isDisposed方法的具 ...
- .net ref java_Java URL.getRef方法代碼示例
本文整理匯總了Java中java.net.URL.getRef方法的典型用法代碼示例.如果您正苦於以下問題:Java URL.getRef方法的具體用法?Java URL.getRef怎麽用?Java ...
- java中move用法_Java IFile.move方法代碼示例
import org.eclipse.core.resources.IFile; //導入方法依賴的package包/類 /** * * 01. Class0 uses Class1 in requi ...
- remote_port java_Java HttpServletRequest.getRemotePort方法代碼示例
import javax.servlet.http.HttpServletRequest; //導入方法依賴的package包/類 public ServletRequestCopy(HttpServ ...
- exhaustion java_Java Player.setExhaustion方法代碼示例
import org.bukkit.entity.Player; //導入方法依賴的package包/類 /** * Set SamaGamesAPI */ @Override public void ...
最新文章
- Openoffice 安装与配置
- 【视频课】8大Pytorch CV实践案例,超30小时视频助你攻略CV三大基础任务(分类分割检测)
- QDD pricing determination does not trigger - set breakpoint to resolve it
- 在html中 标题字体标记的最大取值,西南大学网络教育2020年春0834]《网页设计》作业标准答案...
- 万用表检测常用元器件的方法
- 今天一看,自己发的文章原来这么多了。openeim
- IS-IS详解(五)——IS-IS 三次握手与两次握手
- tcpdump抓包工具详解
- VMWareStation10 密钥
- fileupload控件的属性_FileUpload上传控件用法详解
- python操作mysql批量插入
- 微型计算机原理与接口技术第五版pdf,微型计算机原理与接口技术(第5版)
- 通过阿里云容器镜像服务下载谷歌gcr.io镜像
- PE系统纯净(可以识别nvme固态)
- CityBuilder+DataV制作次世代3D城市大屏,一秒俘获甲方的心!
- Rich Dad Poor Dad
- 半导体通讯标准EAP、SECS/GEM视频介绍
- 生死单元技术!如何在abaqus焊接仿真中的应用
- dockerfile拉取私库镜像_Dockerfile From 私有库认证问题
- 让自己的博客可以在百度上搜索到