rmtp

Flash: computeSpectrum and RMTP

I found a great article on creating a visualization for audio in Flash on the CommunityMX site. Unfortunately, I'm trying to accomplish with audio streaming over RMTP from a Red5 server and that seems to be causing me problems. No matter what I do, the spectrum data return from SoundMixer.computeSpectrum() is empty (all zeros). Meanwhile, I'm seeing conflicting reports across the web and even conflicting information from Adobe.

In one location, Adobe writes that SoundMixer.computeSpectrum() does not work with RTMP data:

For media loaded from RTMP sources, you cannot use the BitmapData.draw() and SoundMixer.computeSpectrum() methods to extract run-time graphics and sound data.1

Then there is the actual documentation for SoundMixer.computeSpectrum():

Note: This method is subject to local file security restrictions and restrictions on cross-domain loading. If you are working with local files or sounds loaded from a server in a different domain than the calling content, you might need to address sandbox restrictions through a cross-domain policy file. For more information, see the Sound class description. In addition, this method cannot be used to extract data from RTMP streams, even when it is called by content that reside in the same domain as the RTMP server.

This method is supported over RTMP in Flash Player 9.0.115.0 and later and in Adobe AIR.2

And finally there's this thread over at the forums for Wowza:

It's official! computeSpectrum does work with Netstream and RTMP served by Wowza 3

Of course, there's no explanation as to how this was actually accomplished using a NetStream/NetConnection and content streamed via RTMP.

Now I'm just horribly confused. Does it work? Or doesn't it? If it's supposed to work, what am I doing wrong?

Footnotes:

1 http://livedocs.adobe.com/flash/9.0/main/wwhelp/wwhimpl/common/html/wwhelp.htm?context=LiveDocs_Parts&file=00000353.html

2 http://livedocs.adobe.com/flash/9.0/ActionScriptLangRefV3/flash/media/SoundMixer.html#computeSpectrum%28%29

3 http://www.wowzamedia.com/forums/showthread.php?t=2360

Syndicate content