问题
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