eb110k
11-27-2007, 08:41 AM
Hello, I'm kind of new to FMS development and I'm having problem with developing "Audio-Only Communication". I could make Video + Audio Communication, but not Audio Only.
The code below does not work. According to instruction PDF of FMS,
NetStream.play() is able to attach MovieClip.play();.
So, I created empty movie clip for audio, but it doesn't pick any stream sound.
What am I missing? Please someone advise.
Thank you.
var live_mic:Microphone = Microphone.get( );
live_mic.setRate(5);
live_mic.setSilenceLevel(20,2000)
//Connections
var rtmpNow:String;
rtmpHost = "rtmp://localhost/audiochat";
var nc:NetConnection = new NetConnection( );
nc.connect(rtmpHost);
//Stream Out
var out_ns:NetStream = new NetStream(nc);
out_ns.attachAudio(live_mic);
out_ns.publish("streamA", "live");
//Stream In
var in_ns:NetStream = new NetStream(nc);
this.createEmptyMovieClip("audio_mc", this.getNextHighestDepth());
audio_mc.attachAudio(in_ns);
in_ns.play("streamB");
The code below does not work. According to instruction PDF of FMS,
NetStream.play() is able to attach MovieClip.play();.
So, I created empty movie clip for audio, but it doesn't pick any stream sound.
What am I missing? Please someone advise.
Thank you.
var live_mic:Microphone = Microphone.get( );
live_mic.setRate(5);
live_mic.setSilenceLevel(20,2000)
//Connections
var rtmpNow:String;
rtmpHost = "rtmp://localhost/audiochat";
var nc:NetConnection = new NetConnection( );
nc.connect(rtmpHost);
//Stream Out
var out_ns:NetStream = new NetStream(nc);
out_ns.attachAudio(live_mic);
out_ns.publish("streamA", "live");
//Stream In
var in_ns:NetStream = new NetStream(nc);
this.createEmptyMovieClip("audio_mc", this.getNextHighestDepth());
audio_mc.attachAudio(in_ns);
in_ns.play("streamB");