• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    公众号

Java WebRtcAudioManager类代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

本文整理汇总了Java中org.webrtc.voiceengine.WebRtcAudioManager的典型用法代码示例。如果您正苦于以下问题:Java WebRtcAudioManager类的具体用法?Java WebRtcAudioManager怎么用?Java WebRtcAudioManager使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。



WebRtcAudioManager类属于org.webrtc.voiceengine包,在下文中一共展示了WebRtcAudioManager类的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的Java代码示例。

示例1: initializeWebRtc

import org.webrtc.voiceengine.WebRtcAudioManager; //导入依赖的package包/类
private void initializeWebRtc() {
  Set<String> HARDWARE_AEC_BLACKLIST = new HashSet<String>() {{
    add("Pixel");
    add("Pixel XL");
  }};

  Set<String> OPEN_SL_ES_WHITELIST = new HashSet<String>() {{
    add("Pixel");
    add("Pixel XL");
  }};

  if (Build.VERSION.SDK_INT >= 11) {
    if (HARDWARE_AEC_BLACKLIST.contains(Build.MODEL)) {
      WebRtcAudioUtils.setWebRtcBasedAcousticEchoCanceler(true);
    }

    if (!OPEN_SL_ES_WHITELIST.contains(Build.MODEL)) {
      WebRtcAudioManager.setBlacklistDeviceForOpenSLESUsage(true);
    }

    PeerConnectionFactory.initializeAndroidGlobals(this, true, true, true);
  }
}
 
开发者ID:CableIM,项目名称:Cable-Android,代码行数:24,代码来源:ApplicationContext.java


示例2: createPeerConnectionFactoryInternal

import org.webrtc.voiceengine.WebRtcAudioManager; //导入依赖的package包/类
private void createPeerConnectionFactoryInternal(Context context, String host) {
	PeerConnectionFactory.initializeInternalTracer();
	if (peerConnectionParameters.tracing) {
		PeerConnectionFactory.startInternalTracingCapture(
				Environment.getExternalStorageDirectory().getAbsolutePath() + File.separator
						+ "webrtc-trace.txt");
	}
	Log.d(TAG, "Create peer connection factory. Use video: " +
			peerConnectionParameters.videoCallEnabled);
	isError = false;

	// Initialize field trials.
	PeerConnectionFactory.initializeFieldTrials(FIELD_TRIAL_AUTOMATIC_RESIZE);

	// Check preferred video codec.
	preferredVideoCodec = VIDEO_CODEC_VP8;
	if (videoCallEnabled && peerConnectionParameters.videoCodec != null) {
		if (peerConnectionParameters.videoCodec.equals(VIDEO_CODEC_VP9)) {
			preferredVideoCodec = VIDEO_CODEC_VP9;
		} else if (peerConnectionParameters.videoCodec.equals(VIDEO_CODEC_H264)) {
			preferredVideoCodec = VIDEO_CODEC_H264;
		}
	}
	Log.d(TAG, "Pereferred video codec: " + preferredVideoCodec);

	// Check if ISAC is used by default.
	preferIsac = false;
	if (peerConnectionParameters.audioCodec != null
			&& peerConnectionParameters.audioCodec.equals(AUDIO_CODEC_ISAC)) {
		preferIsac = true;
	}

	// Enable/disable OpenSL ES playback.
	if (!peerConnectionParameters.useOpenSLES) {
		Log.d(TAG, "Disable OpenSL ES audio even if device supports it");
		WebRtcAudioManager.setBlacklistDeviceForOpenSLESUsage(true /* enable */);
	} else {
		Log.d(TAG, "Allow OpenSL ES audio if device supports it");
		WebRtcAudioManager.setBlacklistDeviceForOpenSLESUsage(false);
	}

	// Create peer connection factory.
	if (!PeerConnectionFactory.initializeAndroidGlobals(context, true, true,
			peerConnectionParameters.videoCodecHwAcceleration)) {
		events.onPeerConnectionError("Failed to initializeAndroidGlobals");
	}
	if (options != null) {
		Log.d(TAG, "Factory networkIgnoreMask option: " + options.networkIgnoreMask);
	}
	factory = new PeerConnectionFactory();
	Log.d(TAG, "Peer connection factory created.");


}
 
开发者ID:ardnezar,项目名称:webrtc-android,代码行数:55,代码来源:PeerConnectionClient.java


示例3: createPeerConnectionFactoryInternal

import org.webrtc.voiceengine.WebRtcAudioManager; //导入依赖的package包/类
private void createPeerConnectionFactoryInternal(Context context) {
    PeerConnectionFactory.initializeInternalTracer();
    if (peerConnectionParameters.tracing) {
        PeerConnectionFactory.startInternalTracingCapture(
                Environment.getExternalStorageDirectory().getAbsolutePath() + File.separator
                        + "webrtc-trace.txt");
    }
    Log.d(TAG,
            "Create peer connection factory. Use video: " + peerConnectionParameters.videoCallEnabled);
    isError = false;

    // Initialize field trials.
    PeerConnectionFactory.initializeFieldTrials("");

    // Check preferred video codec.
    preferredVideoCodec = VIDEO_CODEC_VP8;
    if (videoCallEnabled && peerConnectionParameters.videoCodec != null) {
        if (peerConnectionParameters.videoCodec.equals(VIDEO_CODEC_VP9)) {
            preferredVideoCodec = VIDEO_CODEC_VP9;
        } else if (peerConnectionParameters.videoCodec.equals(VIDEO_CODEC_H264)) {
            preferredVideoCodec = VIDEO_CODEC_H264;
        }
    }
    Log.d(TAG, "Pereferred video codec: " + preferredVideoCodec);

    // Check if ISAC is used by default.
    preferIsac = peerConnectionParameters.audioCodec != null
            && peerConnectionParameters.audioCodec.equals(AUDIO_CODEC_ISAC);

    // Enable/disable OpenSL ES playback.
    if (!peerConnectionParameters.useOpenSLES) {
        Log.d(TAG, "Disable OpenSL ES audio even if device supports it");
        WebRtcAudioManager.setBlacklistDeviceForOpenSLESUsage(true /* enable */);
    } else {
        Log.d(TAG, "Allow OpenSL ES audio if device supports it");
        WebRtcAudioManager.setBlacklistDeviceForOpenSLESUsage(false);
    }

    if (peerConnectionParameters.disableBuiltInAEC) {
        Log.d(TAG, "Disable built-in AEC even if device supports it");
        WebRtcAudioUtils.setWebRtcBasedAcousticEchoCanceler(true);
    } else {
        Log.d(TAG, "Enable built-in AEC if device supports it");
        WebRtcAudioUtils.setWebRtcBasedAcousticEchoCanceler(false);
    }

    if (peerConnectionParameters.disableBuiltInAGC) {
        Log.d(TAG, "Disable built-in AGC even if device supports it");
        WebRtcAudioUtils.setWebRtcBasedAutomaticGainControl(true);
    } else {
        Log.d(TAG, "Enable built-in AGC if device supports it");
        WebRtcAudioUtils.setWebRtcBasedAutomaticGainControl(false);
    }

    if (peerConnectionParameters.disableBuiltInNS) {
        Log.d(TAG, "Disable built-in NS even if device supports it");
        WebRtcAudioUtils.setWebRtcBasedNoiseSuppressor(true);
    } else {
        Log.d(TAG, "Enable built-in NS if device supports it");
        WebRtcAudioUtils.setWebRtcBasedNoiseSuppressor(false);
    }

    // Create peer connection factory.
    if (!PeerConnectionFactory.initializeAndroidGlobals(
            context, true, true, peerConnectionParameters.videoCodecHwAcceleration)) {
        events.onPeerConnectionError("Failed to initializeAndroidGlobals");
    }
    if (options != null) {
        Log.d(TAG, "Factory networkIgnoreMask option: " + options.networkIgnoreMask);
    }
    factory = new PeerConnectionFactory(options);
    Log.d(TAG, "Peer connection factory created.");
}
 
开发者ID:GoBelieveIO,项目名称:voip_android,代码行数:74,代码来源:PeerConnectionClient.java



注:本文中的org.webrtc.voiceengine.WebRtcAudioManager类示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
Java ManagementServerProperties类代码示例发布时间:2022-05-23
下一篇:
Java Headers类代码示例发布时间:2022-05-23
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap