麦克风检测的ActionScript 3 [英] Microphone detection Actionscript 3

查看:135
本文介绍了麦克风检测的ActionScript 3的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有几个问题检测麦克风是否检测与否。我运行功能 Microphone.getMicrophone(),而应返回的如果没有连接麦克风,或者如果用户点击拒绝保安事务委员会上,对吧?

我现在面临的问题是,在某些计算机里没有安装麦克风, Microphone.getMicrophone()仍然描绘出如 [对象话筒]

所以说,例如用户没有麦克风,并点击允许在安全面板,我无法验证是否切换到不同的控件。

如果任何人都可以阐明如何检测一些轻,如果没有麦克风的连接,那么我所有的耳朵。

许多在此先感谢, 请问

解决方案

  VAR MIC:麦克风= Microphone.getMicrophone();

尝试 {
    micName = mic.name
    跟踪(mic.name+ mic.name)
}赶上(五:错误){
    跟踪(没有检测到话筒)
}
 

I'm having a few problems detecting whether a microphone is detected or not. I'm running the function Microphone.getMicrophone() and that should return null if there is no microphone attached, or if the user has clicked Deny on the security panel, right?

The problem I'm facing is, on some computers where there is no microphone installed, Microphone.getMicrophone() still traces out as [object Microphone].

So say for example the user doesn't have a microphone, and clicks allow in the security panel, I can't validate whether to switch to different controls.

If anybody can shed some light on how to detect if there is no microphone connected, then I'm all ears.

Many thanks in advance, Will

解决方案

var mic:Microphone          = Microphone.getMicrophone();

try {
    micName = mic.name
    trace("mic.name "+mic.name)
} catch (e:Error) {
    trace("no mic detected")
}

这篇关于麦克风检测的ActionScript 3的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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