Flash 中的 AEC,getEnhancedMicrophone [英] AEC in Flash, getEnhancedMicrophone

查看:18
本文介绍了Flash 中的 AEC,getEnhancedMicrophone的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

有下一个问题:

var mic:Microphone = Microphone.getEnhancedMicrophone();
mic.setLoopBack(true);

而且我听不到任何声音...这是什么?当我编写 Microphone.getMicrophone() 时,一切正常,我听到了声音.

And I don`t hear any sound... What is it? When I write Microphone.getMicrophone() all work right and I hear sounds.

推荐答案

要解决此问题,请尝试以下步骤:

To work around it, try the following steps:

1) 安装 调试播放器 10.3 或更高版本

1) install debug player 10.3 or higher

很可能您使用非调试版的 Flash Player 运行它,这就是您错过重要警告和异常的原因.

2) 允许用户接受对麦克风的访问:

2) allow users to accept access to the microphone:

Security.showSettings("2");

3) 使用以下选项编译 SWF:

3) compile a SWF with following option:

-swf-version=12

要使用 10.3 中的新功能,您必须发布 SWF 以定位Flash Player 11".否则 getEnhancedMicrophone() 函数将不可见.

要使其在 Adob​​e Flash CS5 中运行,您需要:

To make it work in Adobe Flash CS5 you need to:

3.1) 转到

${FLASH_CS5_HOME}CommonConfigurationActionScript 3.0

3.2) 创建一个名为 FP10.3

3.2) create a new folder with the name FP10.3

3.3) 复制文件并粘贴到以下位置:

3.3) copy the file and paste it in the following location:

${FLASH_CS5_HOME}CommonConfigurationActionScript 3.0FP10.3

3.4) 将 swc 名称重命名为 playerglobal.swc

3.4) rename the swc name to playerglobal.swc

3.5) 转到

${FLASH_CS5_HOME}CommonConfigurationPlayers

3.6) 创建 FlashPlayer10_1.xml 的副本并重命名为 FlashPlayer10_3.xml

3.6) create a copy of FlashPlayer10_1.xml and rename as FlashPlayer10_3.xml

3.7) 在编辑器中打开它并根据以下内容进行更改:

3.7) open it in an editor and change according to below:

<player id="FlashPlayer10.3" version="12" asversion="3">
   <name>Flash Player 10.3</name>
   <path builtin="true"/>
   <path platform="WIN">Device Central/adcdl.exe</path>
   <path platform="MAC">Device Central/adcdl</path>
   <playerDefinitionPath as2="$(UserConfig)/Classes/FP10;$(UserConfig)/Classes/FP9;$(UserConfi g)/Classes/FP8;$(UserConfig)/Classes/FP7" as3="$(AppConfig)/ActionScript 3.0/FP10.3/playerglobal.swc" />

3.8) 关闭 flash 应用程序,如果启动并重新启动 flash 应用程序

3.8) close the flash application if launched and restart the flash application

3.9) 如果您及时遵循所有内容,您将从发布设置中的目标播放器中的 Flash player 10.3 并将目标更改为 Flash Player 10.3

3.9) if you promptly followed everything you will Flash player 10.3 in the target players from the publish settings and change your target to Flash Player 10.3

3.10) 现在导入两个语句:

3.10) now import two statements:

      import flash.media.Microphone;
      import flash.media.MicrophoneEnhancedMode;

[/编辑]

示例:

public function init():void {
    var mic:Microphone = Microphone.getEnhancedMicrophone();
    Security.showSettings("2");
    mic.setLoopBack(true);
    if (mic != null) {
        mic.setSilenceLevel(0);
        mic.rate = 16;
        mic.addEventListener(ActivityEvent.ACTIVITY, activityHandler);
        mic.addEventListener(StatusEvent.STATUS, statusHandler);
    }
}

private function activityHandler(event:ActivityEvent):void {
    trace("activityHandler: " + event);
}

private function statusHandler(event:StatusEvent):void {
    trace("statusHandler: " + event);
}

希望这会有所帮助.

这篇关于Flash 中的 AEC,getEnhancedMicrophone的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆