4

I want to get the activity level of audio of a NetStream, similar to how you can do it with a Microphone. In this article, AS3: Audio activity level of a NetStream NetStreamInfo.audioBytesPerSecond is said to be the solution. However, audioBytesPerSecond indicates how many data volume the stream have. It does not get volume level of the stream. It is not the same as microphone.activityLevel.

Is there any way to get volume level of netStream?

Community
  • 1
  • 1
user872176
  • 108
  • 1
  • 7

2 Answers2

0

Edit: it seems that you're looking for sound spectrum, not volume level. SoundMixer class a method called computeSpectrum, which fills an instance of ByteArray with raw sound data of a single moment. You can read about SoundMixer more here: http://help.adobe.com/en_US/air/reference/html/flash/media/SoundMixer.html And here's a an example with source code that could aid you in achieving your goal: http://www.todaycreate.com/2007/02/18/actionscript-3-spectrum-analyzer

NetStream has soundTransform property which references to a SoundTransform object which in turn has volume property for getting and setting volume level. Is this what you're looking for?

package
  • 4,741
  • 1
  • 25
  • 35
  • Thanks for your reply. I want to make this kind of volume meter. http://www.youtube.com/watch?v=iixBz5JK6s4 I think SoundTransform.volume is the output volume level which users set. It will not change until user change its setting. (If I set it as 1, I get 1 whenever I do getVolume) Microphone.activityLevel would change depend on its input. I want to get microphone activity level of the streaming source client. – user872176 Nov 26 '11 at 01:58
  • Thanks again. It seems that SoundMixer class cannot be used for dynamic sound such as streaming. – user872176 Nov 29 '11 at 07:02
  • But thank you very much for your suggestion. Data I want to get is exactly what SoundMixer.computeSpectrum gives. – user872176 Nov 29 '11 at 07:04
0

Finally, I found the way to get SoundMixer.computeSpectrum of streaming movie. I made it with Wowza Media Server and flash 10.1. How to do; http://www.wowza.com/forums/showthread.php?7055-Example-of-how-to-use-ComputeSpectrum-with-Wowza-Pro

The following line was crutial(on page 2) ns.bufferTime = 3;

user872176
  • 108
  • 1
  • 7