Groups | Blog | Home
all groups > flash actionscript > november 2006 >

flash actionscript : FLV Video and Audio question


cewingCME
11/13/2006 7:01:56 PM
I have a situation where I'm loading up a video (FLV) into a Video object on
the stage using the NetConnection, NetStream, and Video classes and action
script. I want to know if the FLV I'm loading has a soundtrack or not (some of
the movies don't) so that I can choose to play a default soundtrack or let the
movie soundtrack play. Is such a thing possible?

I've noticed that the NetStream object seems to have a property, once 'play'
has been called, called 'audioCodec'. I don't find any documentation of this
property anywhere, and I wonder if it could be used to test for audio. My test
case has no sound, and the codec is listed as 0. Would this be a reliable
indicator of the presence of an audio track? Is there a place I can find the
list of codecs and the integers used to represent them in this property??

Thanks much

Cris
arunbe
11/14/2006 12:00:00 AM
hi
you just read more about NetStream.onMetaData function.
cewingCME
11/14/2006 3:26:40 PM
arunbe,

I read the live docs information about NetStream.onMetaData, and this tells me
that it is possible that I might get some information about an audio codec, but
it doesn't really help all that much in learning if there is a way to tell if
there is an audio track present at all. Does such a possibility exist?

C
cewingCME
11/14/2006 3:42:27 PM
Sorry, just found the live doc for working with metadata which informs me that flv without audio tracks return 'undefined' for audio related metadata. Thanks, that ought to do it.

arunbe
11/14/2006 3:45:14 PM
AddThis Social Bookmark Button