[Red5] SoundMixer.computeSpectrum rtmp livestream
j at hauf.org
Sat Nov 28 07:30:29 PST 2009
I did noting special. I'm using red5 0.9 RC1 and the Flash Player
10.0.32.18 Debugger on both sides.
On the client that plays the stream I use:
var ns:NetStream = new NetStream(netConnection);
//This line is needed - otherwise computeSpectrum
//is not working on live streams.
ns.bufferTime = 0.01;
ns.client = this;
the visualization is done by computeSpectrum in onEnterFrame:
var byteArray:ByteArray = new ByteArray();
On the publishing side I use:
this.micStream = new NetStream(this.netConnection);
this.mic = Microphone.getMicrophone();
this.mic.codec = SoundCodec.SPEEX;
this.mic.setUseEchoSuppression(true); this.mic.encodeQuality = 10;
this.mic.rate = 22;
this.mic.soundTransform.volume = 100;
//No camera needed
In the red5-web.xml configuration I use this to allow sample access of
the live sound in the flash player (If you omit this you will get a
sandbox security exception):
<bean id="rtmpSampleAccess" class="org.red5.server.stream.RtmpSampleAccess">
<property name="audioAllowed" value="true"/>
<property name="videoAllowed" value="true"/>
As you can see the only "unusual" thing is the bufferTime on the client
side. If I comment out this line SoundMixer.computeSpectrum does only
put "0" values in the byteArray.
Hope that helps,
Dan Daemon wrote:
> Can you explain more better how did you make it work please?
> On Fri, Nov 27, 2009 at 7:57 PM, John Hauf <j at hauf.org> wrote:
>> now I found a solution/workaround for this issue: When you set the
>> netstream.bufferTime to a non zero value (even a very small one like
>> 0.01), SoundMixer.computeSpectrum works well with the live stream.
>> John Hauf wrote:
>>> I'm new to this list and want to thank all developers of red5 for the
>>> great software.
>>> I'm devloping my first project with flex and red5 at the moment and try
>>> to use SoundMixer.computeSpectrum on a rtmp live stream. When I check
>>> the byteArray which is filled by computeSpectrum, it only contains zero
>>> If I use computeSpectrum with a rtmp file-stream, stored in the
>>> "streams" directory of the red5-server, everything works perfect. The
>>> only thing I change is the name of the stream in the
>>> Does anybody have an idea why computeSpectrum is not working with the
>>> live stream?
>>> Thank you,
>>> Red5 mailing list
>>> Red5 at osflash.org
>> Red5 mailing list
>> Red5 at osflash.org
> Red5 mailing list
> Red5 at osflash.org
More information about the Red5