Check if users flash player has audio capabilities. (Capabilities.hasAudio)

一曲冷凌霜 提交于 2019-12-23 10:55:11

问题


Is it possible to check if the user has a sound card? I found Capabilities.hasAudio but dont know if that is the value I should look at.

trace(Capabilities.hasAudio)

"Specifies whether the system has audio capabilities. This property is always true.


回答1:


The docs are unclear on this, but I think that the properties in the Capabilities class tells you what the capabilities of the player is, not necessarily the system. For instance, the desktop players will always return true for hasAudio, regardless of whether the system actually can play audio or not.

Unfortunately, I don't think there's any way of determining the audio capabilities of the actual system. If you disable your sound card for instance, hasAudio will still return true AFAIK.




回答2:


Sound.play() will return null if there is no device present.



来源:https://stackoverflow.com/questions/4511146/check-if-users-flash-player-has-audio-capabilities-capabilities-hasaudio

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!