示例#1
0
        public void Add(string id, VoiceData voice)
        {
            VoiceBuffer buffer = null;

            buffers_.TryGetValue(id, out buffer);

            if (buffer == null)
            {
                buffer = new VoiceBuffer();
                buffers_.Add(id, buffer);
            }

            buffer.Add(voice.data);
        }
示例#2
0
        void UpdateSendingRecordedData()
        {
            if (recorder == null || !recorder.isRecording)
            {
                return;
            }
            if (client == null || !client.isConnected)
            {
                return;
            }

            while (recorder.GetRecordedData(ref buffer_) > 0)
            {
                var voice = new VoiceData()
                {
                    data = buffer_
                };
                client.SendByChannel(VoiceMessage.ClientToHost, voice, channelId);
            }
        }