views:

993

answers:

3

Hi guys,

I'm pulling my hair out (once again), trying to find a way to read the activity level of audio of a NetStream, similar to how you can do it with a Microphone. I'd hate to have to let each client send it's activitylevel through SharedObjects or the like, which right seems to be the only way to actually get it to work.

Thanks so much in advance!

-Dave

+1  A: 

That's probably the only way to do it. NetStream is a pretty generic object by design. The best site to ask a question like this might be on FlashComGuru.com where a lot of NetStream/FMS guys hang out.

Jasconius
Seems like a lot of objects in Flex are generic by design, I keep running into these limitations. I highly doubt I'm the only one who wants something like this.. Too bad. Thanks for your answer!
Dave
+3  A: 

In AS3 the Netstream Object has a property called .info. This holds the object NetStreamInfo. NetstreamInfo will give you all sorts of metrics. Among them is the property 'audioBytesPerSecond' which will give you an indication of the audio activity at a certain point in time. Requesting the NetStreamInfo for the incoming stream will provide you with the data from the client. Requesting the NetStreamInfo for the outgoing stream will provide you data from your own cam and mic activity. More detail on the NetStreamInfo object can be found here: http://help.adobe.com/en%5FUS/AS3LCR/Flash%5F10.0/flash/net/NetStreamInfo.html

hhelms
This seems plausible. I bow to your Netstream knowledge.
Jasconius
Thanks for your answer, it seems like the best thing to do for now. My apologies for missing out on giving you my own bounty, I was out of the office all day yesterday and came in this morning only to realize the deadline was sometime this night (Different timezones).Thanks again!
Dave
No problem and thanks very much. I use this myself regularly. NetStreamInfo does not have any events like the mic activity event, but polling it a couple of times a second works fine for me.
hhelms
A: 

I've seen Flex examples that displays an eq bar.

the code uses two objects

SoundTransform and flash.media.SoundChannel

it functions by dispatching a custom event that has a property which is the SoundChannel object containing the EQ of the playing audio stream.

not sure exactly how the doe works cause it's bundled up in flex, or how to get from the NetStream to the audio based SoundChannel.

The example is in chapter 15 "Building your own components" of the book "Flex 3 component solutions" by jack herrington. published by friends of ed (the pink spine books).

hope that helps.

Fire Crow