0

I'm writting p2p voice chat in Flex, with manipulating audio data. I attached audio (microphone) to NetStream and everything works fine. Is there any way to access microphone samples before sending it to other peer? Thank you in advance for your help.

Nabuchodonozor
  • 704
  • 1
  • 6
  • 13

1 Answers1

0

Yes, to capture microphone audio, listen for the sampleData events dispatched by a Microphone instance. The SampleDataEvent object dispatched for this event contains the audio data.

See this page for complete info and examples on how to do that!

Jason Reeves
  • 1,716
  • 1
  • 10
  • 13
  • I tried to do it. I can access these data after they are sent through the NetStream – Nabuchodonozor Jan 06 '13 at 11:03
  • what are you trying to accomplish before it goes over the net stream? Have you looked at using SoundTransform? – Jason Reeves Jan 07 '13 at 22:58
  • I want to encrypt the data before sending them. I think that functionality of SoundTransform doesn't fit it. – Nabuchodonozor Jan 08 '13 at 15:01
  • There are many built ins for this. RTMPE (uses 128 bit public-key-exchange algorithm), RTMPS (uses SSL), RTMFP (P2P uses 128 bit block cipher algorithm). Also, there is support for session nonces for more auth security. [Here is a link](http://help.adobe.com/en_US/flashmediaserver/techoverview/WS5b3ccc516d4fbf351e63e3d119ed944af6-7ffb.html) that covers all of the secure network protocols – Jason Reeves Jan 08 '13 at 15:50
  • I'm using RTMFP. Just want to make it clear, this protocol is using symmetric key block cipher algorithm to encrypt stream data. Are the keys exchanged between peers by secure protocol (using sth like RSA (public key algorithm))? Where the symmetric key is generated? Is there any way to provide generated symmetric key? – Nabuchodonozor Jan 08 '13 at 16:27
  • yes it uses the public-key-exchange algorithm and when an RTMFP peer connects to another RTMFP peer using a peer ID, the public-key-exchange algorithm is tied to the peer ID so that it is not possible to conduct a man-in-the-middle attack – Jason Reeves Jan 08 '13 at 16:34
  • And the symmetric key is generated by peer or server (particulary I'm using Adobe Cirrus)? – Nabuchodonozor Jan 08 '13 at 16:47
  • They negotiate the keys between peers. [Here is a link](http://tools.ietf.org/html/draft-thornburgh-adobe-rtmfp-01) to a doc from Adobe that goes EXTREMELY deep into the RTMFP protocol data exchange packets and encryption. – Jason Reeves Jan 08 '13 at 17:02
  • Thank you for your help. It was extremely helpful for me. Although the topic has changed I tick V on this answer. – Nabuchodonozor Jan 08 '13 at 17:14
  • You're welcome. Yeah the answer was correct for your question... just turned out we weren't working with the right question. Glad to help! – Jason Reeves Jan 08 '13 at 17:37