Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    text
    copied!<p>You stumbled upon one of the strange quirks of NetStream. It can publish sound from the microphone, but not from a arbitrary sound source. There is some workarounds, some more complex than the others.</p> <ul> <li><p>Streaming through a virtual microphone. The easiest workaround, and the best (IMO) if your project allows you to use it. You just have to install a virtual microphone/camera software (ex : <a href="http://www.manycam.com/" rel="noreferrer">ManyCam</a>) and use it to stream your mp3 file(s) through a virtual microphone. With that done, you just have to bind this microphone to your AS3 app. Sadly, it doesn't work for your project, since you can't reasonably ask of the publishing peer to install a virtual microphone.</p></li> <li><p>Streaming using<code>Sound.extract()</code>, <code>NetStream.send()</code> and <code>SampleDataEvent.SAMPLE_DATA</code>. As you might know, <code>NetStream.send()</code> can be used to send messages to peers. The thing is, those messages are serialized and can be <code>ByteArray</code>. Thus, you can send audio data samples with <code>NetStream.send()</code>. The publishing pee apps can obtain the data samples with <code>Sound.extract()</code>, and the receiving apps can play them thanks to the <code>SAMPLE_DATA</code> event. One of the problems will be to know when you should send new samples. To manage that, you would recommend also using the <code>SAMPLE_DATA</code> in the publishing app and send new data each time the <code>SAMPLE_DATA</code> event occurs. The main issue with this method is that since you don't use the standard way of RTMP to stream audio, it needs a custom app for the receiver to play it. Given what you said of your project, it shouldn't be a problem.</p></li> <li><p>Reproducing the RTMFP protocol using <code>Socket</code>. It would be long, very complex, and error-prone. I would never recommend to do this except perhaps as a learning experience. You would need to read, understand and implement most of the <a href="http://tools.ietf.org/html/draft-thornburgh-adobe-rtmfp-01" rel="noreferrer">RTMFP Specification</a>.</p></li> </ul>
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload