Skip to main content
Participating Frequently
September 17, 2010
Question

audioSampleAccess - capture audio from RTMFP subscribed stream

  • September 17, 2010
  • 1 reply
  • 2071 views

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

    This topic has been closed for replies.

    1 reply

    Participating Frequently
    September 17, 2010
    tomfooAuthor
    Participating Frequently
    September 17, 2010

    Thanks the suggestion Seth, but I'm not trying to compute the spectrum, I'm trying to get the audio samples (so that I can store/record it, and play it back later).

    thanks

    tom

    Participating Frequently
    September 17, 2010

    Take a few minutes to read through the ASDocs for that method, and the example that follows. I think this is doing the same sort of thing as you can do with video sample access and BitmapData.draw() to generate periodic graphic snapshots of an underlying video stream.

    In the case of video or audio, you're only being given access to take samples/snapshots. There is no API in the Player/AIR that lets you extract the complete audio/video byte stream from a source NetStream.

    Best,
    Seth