red5:如何发送麦克风流?

发布于 2024-12-22 14:19:30 字数 128 浏览 1 评论 0原文

我正在使用 red5 和 flex。实际上我的目标是将麦克风流从服务器发送到客户端并在客户端播放。类似地,将麦克风流从客户端发送到服务器并在服务器端播放。无需存储直播流。

这可能吗?我怎样才能在red5和flex中做到这一点?

i am using red5 and flex. Actually my objective is to send microphone stream from the server to the client and play it on the client side. Similarly send microphone stream from client to server and play it on the server side. No need to store the live stream.

Is this possible? how can i do it in red5 and flex?

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

や三分注定 2024-12-29 14:19:30
private var nc:NetConnection;
private var mic:Microphone;

private function init():void
{
    nc=new NetConnection ;
    nc.connect (your rtmppath,"anchor");
    mic=Microphone.getMicrophone();
    mic.rate=11;
    nc.addEventListener (NetStatusEvent.NET_STATUS,checkConnect);
}

private function checkConnect (e:NetStatusEvent)
{
    good=e.info.code == "NetConnection.Connect.Success";
    if (good)
    {
        this.attachAudio (mic);
        this.publish (stream,"live");
    }
}

从客户端,要播放现场声音,请将您的网络流与当前的网络连接连接起来:

private var nc:NetConnection;
private var mic:Microphone;
private var netstream:NetStream = new NetStream
private function init():void
{
    nc=new NetConnection ;
    nc.connect (your rtmppath,"viewer");
    nc.addEventListener (NetStatusEvent.NET_STATUS,checkConnect);
}

private function checkConnect (e:NetStatusEvent)
{
    good=e.info.code == "NetConnection.Connect.Success";
    if (good)
    {
        var vid:Video = new Video
        this.attachNetStream(ns)
        netStream.play(presentation);
    }
}
private var nc:NetConnection;
private var mic:Microphone;

private function init():void
{
    nc=new NetConnection ;
    nc.connect (your rtmppath,"anchor");
    mic=Microphone.getMicrophone();
    mic.rate=11;
    nc.addEventListener (NetStatusEvent.NET_STATUS,checkConnect);
}

private function checkConnect (e:NetStatusEvent)
{
    good=e.info.code == "NetConnection.Connect.Success";
    if (good)
    {
        this.attachAudio (mic);
        this.publish (stream,"live");
    }
}

From client-side, to play live sound, connect your netstream with current netconnection also:

private var nc:NetConnection;
private var mic:Microphone;
private var netstream:NetStream = new NetStream
private function init():void
{
    nc=new NetConnection ;
    nc.connect (your rtmppath,"viewer");
    nc.addEventListener (NetStatusEvent.NET_STATUS,checkConnect);
}

private function checkConnect (e:NetStatusEvent)
{
    good=e.info.code == "NetConnection.Connect.Success";
    if (good)
    {
        var vid:Video = new Video
        this.attachNetStream(ns)
        netStream.play(presentation);
    }
}
~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文