English 中文(简体)
• 如何从有氟菲克斯的客户中公布一个声音流?
原标题:How to publish an audio stream from a client with FluorineFx?

我可以指出,如何在客户使用Fluorine Fx,从客户到服务器上公布一个音频流。 我们希望通过已经建立的网络网络将用户的录音数据输入到上游。 氟化硫有一门NetStream级,但没有出版方法。 氟化烃中的NetStream级只有游戏方法。 但是,就我所知,这从客户的服务器起就起。

是否在FluorineFx中公布,或者我是否误用一些东西?

最佳回答

不幸的是,这一特点似乎没有得到执行。

问题回答

最近,我还研究了流体法。 很奇怪的是,尽管《公约》提到了《公约》,但《守则》中并未执行《公约》。

实际上,在其“Engine.cs”中,还有类似的执行PullAndPush(PullAndPush(),能够从FLV档案中提取数据并将其推向偏僻地区。

因此,我尝试了网上班级的一些类似守则,几乎可以奏效,可以把溪流推到rtmplite。 服务器,可在rtmplite的测试网上运行。

public void Publish(params object[] arguments)
        {
            ValidationUtils.ArgumentConditionTrue(arguments != null && arguments.Length > 0, "arguments", "At least the name of a file must be specified");
            ValidationUtils.ArgumentNotNullOrEmptyOrWhitespace(arguments[0] as string, "name");
            _name = arguments[0] as string;


            INetConnectionClient client = _connection.NetConnectionClient;
            RtmpConnection connection = _connection.NetConnectionClient.Connection as RtmpConnection;
            IPendingServiceCallback callback = new CreateStreamCallBack(this, connection, new PublishCallBack(this,_connection, _name));
            client.Call("createStream", callback);
        }

        public void AttachFile(string filepath)
        {

            FileProvider fileProvider = new FileProvider(this.Scope, new System.IO.FileInfo(filepath));
            _pullPushPipe.Subscribe(fileProvider, null);
            PullAndPush();
        }

        public void PullAndPush()
        {

            while(true)
            {
                var msg = _pullPushPipe.PullMessage();
                if (msg == null)
                {
                    // No more packets to send
                    Stop();
                    break;
                }
                else
                {
                    if (msg is RtmpMessage)
                    {
                        RtmpMessage rtmpMessage = (RtmpMessage)msg;
                        IRtmpEvent body = rtmpMessage.body;
                     //   SendMessage(rtmpMessage);
                        // Adjust timestamp when playing lists
                        //  EnsurePullAndPushRunning();
                        _pullPushPipe.PushMessage(msg);
                    }
                }
            }
        }

        class PublishCallBack : IPendingServiceCallback
        {
            NetConnection _connection;
            NetStream _stream;
            string _name;
            string _mode;

            public PublishCallBack(NetStream stream, NetConnection connection, string name, string mode = "live")
            {
                _connection = connection;
                _name = name;
                _mode = mode;
                _stream = stream;
            }

            public void ResultReceived(IPendingServiceCall call)
            {
                if ("createStream".Equals(call.ServiceMethodName))
                {
                    RtmpConnection connection = _connection.NetConnectionClient.Connection as RtmpConnection;
                    object[] args = new object[2] {_name, _mode};
                    PendingCall pendingCall = new PendingCall("publish", args);
                    pendingCall.RegisterCallback(new PublishResultCallBack());
                    connection.Invoke(pendingCall, (byte)connection.GetChannelForStreamId(_stream.StreamId));
                }
            }
        }




相关问题
Anyone feel like passing it forward?

I m the only developer in my company, and am getting along well as an autodidact, but I know I m missing out on the education one gets from working with and having code reviewed by more senior devs. ...

NSArray s, Primitive types and Boxing Oh My!

I m pretty new to the Objective-C world and I have a long history with .net/C# so naturally I m inclined to use my C# wits. Now here s the question: I feel really inclined to create some type of ...

C# Marshal / Pinvoke CBitmap?

I cannot figure out how to marshal a C++ CBitmap to a C# Bitmap or Image class. My import looks like this: [DllImport(@"test.dll", CharSet = CharSet.Unicode)] public static extern IntPtr ...

How to Use Ghostscript DLL to convert PDF to PDF/A

How to user GhostScript DLL to convert PDF to PDF/A. I know I kind of have to call the exported function of gsdll32.dll whose name is gsapi_init_with_args, but how do i pass the right arguments? BTW, ...

Linqy no matchy

Maybe it s something I m doing wrong. I m just learning Linq because I m bored. And so far so good. I made a little program and it basically just outputs all matches (foreach) into a label control. ...

热门标签