Flash: netStream.info.audioBytesPerSecond alternative? Or how to detect if audio is present?
We have a flash app streaming live video to our clients which may or may not have available. When audio is available, we are showing controls to mute or alter the audio volume. When audio is not available, we hide those con开发者_开发技巧trols. These are necessarily different streams, but could be the same stream where the broadcaster has disbaled their microphone at some point. So the client may have detected audio initially had displayed controls, but once the broadcaster disabled their mic, the client on the receiving end recognizes no more audio is transmitting and hides the controls.
We were doing this in Flex 4, targetting flash 10, by using the netSream.info.audioBytesPerSecond property on the receiving client to see if any audio was being sent down. However we've been informed by the powers that be that we need to target flash 9 in which this property is not available.
So, in short, is there a way in Flex 3.5, targetting flash 9, to determine if a live stream has audio available? Note, we tried metaData as well for the initial indication of audio, but we need to be able to check on a timer periodically as the broadcaster may turn off their mic and thus disable audio mid stream.
What about using SoundMixer.computeSpectrum() and check the value of the ByteArray associated with it with an enterFrame event? As soon as the ByteArray is filled with values other than zero , audio is being detected
精彩评论