您好 我想在FMS中保存加载的声音。
public function Record()
{
nc.connect("rtmp://192.168.1.2:1935/videoRecorder");
nc.addEventListener(NetStatusEvent.NET_STATUS, netStatusHandler);
play_btn.visible = stop_btn.visible = start_btn.visible = false;
}
function netStatusHandler(event:NetStatusEvent):void
{
t1_txt.text = event.info.code;
trace(event.info.code);
switch (event.info.code)
{
case "NetConnection.Connect.Success" :
connectStream();
break;
case "NetStream.Play.StreamNotFound" :
//trace("Stream not found: " + videoURL);
break;
}
}
function connectStream()
{
ns = new NetStream(nc);
var mic:Microphone = Microphone.getMicrophone();
var cam:Camera = Camera.getCamera();
if (cam)
{
cam.setMode(400,300,15,false);
cam.setQuality(0,100);
ns.attachAudio(mic);
ns.attachCamera(cam);
video.attachCamera(cam);
video.height = 300;
video.width = 400;
addChild(video);
start_btn.visible = true;
start_btn.addEventListener(MouseEvent.MOUSE_UP,startRecord);
}
else
{
t1_txt.text = "No camera attached";
}
}
这是我的代码。但是我需要保存我装的麦克风声。有可能吗?
答案 0 :(得分:0)
无法将声音附加到NetStream。 您可以通过以下方式解决问题:
干杯
Tamas Gronas