1 Reply Latest reply on Sep 21, 2010 4:27 PM by AdamLane

    audioSampleAccess - capture audio from RTMFP subscribed stream

    tomfoo

      I'd like to capture the audio data from an RTMFP stream to which the client is subscribed (so I get a bytearray of audio samples).

      The presence of the audioSampleAccess propery on the NetStream class certainly makes that sounds possibe:

       

      For RTMFP connections, specifies whether peer-to-peer subscribers on this NetStream are allowed to capture the audio stream. When FALSE, subscriber attempts to capture the audio stream show permission errors.

       

      But I dont see how I would do it. In the case of video, I see I could use BitmapData.draw(), and discucced here: http://forums.adobe.com/message/1066374#1066374

      But in the case of audio, I dont know how to address the audio data to get it into a bytearray.

       

      Any ideas?

       

      My instinct said this wasnt possible, but the presence of the 'audioSampleAccess' property makes me think it might be..

       

      thanks

       

      tom

        • 1. Re: audioSampleAccess - capture audio from RTMFP subscribed stream
          AdamLane

          I've never done this myself, but I found this in the docs:

           

          Call the SoundMixer.computeSpectrum() method in client-side ActionScript 3.0 to read the raw sound data for a waveform that is currently playing. For more information, see the SoundMixer.computeSpectrum() entry in the ActionScript 3.0 Language and Components Reference and "Accessing raw sound data" in Programming ActionScript 3.0.