简体   繁体   English

有没有办法在Actionscript 3中获得netStream的音量级别?

[英]Is there any way to get volume level of netStream in Actionscript 3?

I want to get the activity level of audio of a NetStream, similar to how you can do it with a Microphone. 我想获得NetStream的音频活动级别,类似于使用麦克风的方式。 In this article, AS3: Audio activity level of a NetStream NetStreamInfo.audioBytesPerSecond is said to be the solution. 在本文中, AS3:NetStream的音频活动级别 NetStreamInfo.audioBytesPerSecond被认为是解决方案。 However, audioBytesPerSecond indicates how many data volume the stream have. 但是,audioBytesPerSecond指示流具有的数据量。 It does not get volume level of the stream. 它没有获得流的音量级别。 It is not the same as microphone.activityLevel. 它与microphone.activityLevel不同。

Is there any way to get volume level of netStream? 有没有办法获得netStream的音量?

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. SoundMixer类是一个名为computeSpectrum的方法,它使用单个时刻的原始声音数据填充ByteArray的实例。 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 您可以在这里阅读有关SoundMixer更多信息: http//help.adobe.com/en_US/air/reference/html/flash/media/SoundMixer.html这里有一个源代码示例,可以帮助您实现目标: 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. NetStream具有soundTransform属性,该属性引用SoundTransform对象,该对象又具有用于获取和设置音量级别的volume属性。 Is this what you're looking for? 这是你在找什么?

Finally, I found the way to get SoundMixer.computeSpectrum of streaming movie. 最后,我找到了获得流媒体电影的SoundMixer.computeSpectrum的方法。 I made it with Wowza Media Server and flash 10.1. 我用Wowza Media Server和flash 10.1制作了它。 How to do; 怎么做; http://www.wowza.com/forums/showthread.php?7055-Example-of-how-to-use-ComputeSpectrum-with-Wowza-Pro 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; 以下行是重要的(第2页)ns.bufferTime = 3;

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM