<p>Is there a way to detect if a flash movie contains any sound or is playing any music?<br>
It would be nice if this could be done inside a webbrowser (actionscript <strong>from another flash object</strong>, javascript,..) and could be done <em>before</em> the flash movie starts playing.</p>

<p>However, I have my doubts this will be possible altogether, so any other (programmable) solution is also appreciated</p>

[{'answer_id': 43519, 'author': 'Stu Thompson', 'author_id': 2961, 'author_profile': 'https://Stackoverflow.com/users/2961', 'pm_score': 3, 'selected': True, 'text': '<p>Yes, on the server side for sure.  Client side?  I don\'t know.  (I\'m a serverside kind of guy.) </p>\n\n<p>On the server side, one would have to parse the file, read the header and/or look for audio frames.  (I\'ve ported a haskel FLV parser to Java for indexing purposes myself, and there are other parsing utilities out there.  It is possible.)</p>\n\n<p><a href="http://osflash.org/flv" rel="nofollow noreferrer">osflash.org\'s FLV page</a> has the gory details.  Check out the FLV Format sections\'s FLV Header table.  </p>\n\n<pre><code>FIELD       DATA TYPE      EXAMPLE                  DESCRIPTION\n Signature   byte[3]        “FLV”                    Always “FLV”\n Version     uint8          “\\x01” (1)               Currently 1 for known FLV files\n Flags       uint8 bitmask  “\\x05” (5, audio+video)  Bitmask: 4 is audio, 1 is video\n Offset      uint32-be      “\\x00\\x00\\x00\\x09” (9)   Total size of header (always 9 for known FLV files) \n</code></pre>\n\n<hr>\n\n<p>EDIT: My client side coding with Flash is non-existent, but I believe there is an onMetaDataLoad event that your code could catch.  That might be happening a bit late for you, but maybe it is good enough?</p>\n'}, {'answer_id': 43911, 'author': 'grapefrukt', 'author_id': 914, 'author_profile': 'https://Stackoverflow.com/users/914', 'pm_score': 1, 'selected': False, 'text': '<p>Are you asking about FLV video files or Flash "movies" as in SWF?</p>\n\n<p><em>Just to clarify, an FLV is the Flash Video Format (or whatever the acronym is), a regular Flash movie/application/banner would be an SWF. These are very different file formats.</em></p>\n'}, {'answer_id': 58240, 'author': 'Antti', 'author_id': 6037, 'author_profile': 'https://Stackoverflow.com/users/6037', 'pm_score': 0, 'selected': False, 'text': '<p>With the <a href="https://web.archive.org/web/20080917191415/http://livedocs.adobe.com/flash/9.0/ActionScriptLangRefV3/flash/utils/ByteArray.html" rel="nofollow noreferrer">ByteArray</a> you can do pretty much what you want. Before starting playback you can analyze the bytes of the FLV header (use byteArray.readByte() and refer to the specs) to determine to check if the audio flag is on. Since the FLV header is loaded almost instantly this shouldn\'t cause any inconvenient delay for the user.</p>\n\n<p>With SWF\'s it\'s a lot tricker -- i\'m pretty sure there\'s no easy way to determine in advance if a swf plays audio somewhere. A way to do it could be to look at what assets the SWF has defined in the library but also then the swf could just load an external audio file (or even generate it with some hacks or the new apis in Flash player 10). If the swf\'s are user submitted (or something similar that\'s out of your immediate control) I think this is a risky road.. </p>\n'}]
['https://Stackoverflow.com/questions/43503', 'https://Stackoverflow.com', 'https://Stackoverflow.com/users/46/']