コード例 #1
0
        private void Init(IPAddress[] addresses)
        {
            //Debug.Log("Host addresses recv");
            if (addresses == null || addresses.Length == 0)
            {
                Debug.LogError("Failed to get addresses!");
                throw new ArgumentException(
                          "Unable to retrieve address from specified host name.",
                          _hostName
                          );
            }

            _addresses = addresses;
            var endpoint = new IPEndPoint(_addresses[0], _port);

            _audioDecodeThread  = new AudioDecodeThread(_outputSampleRate, _outputChannelCount, this);
            _decodingBufferPool = new DecodingBufferPool(_audioDecodeThread);
            _udpConnection      = new MumbleUdpConnection(endpoint, _audioDecodeThread, this);
            _tcpConnection      = new MumbleTcpConnection(endpoint, _hostName,
                                                          _udpConnection.UpdateOcbServerNonce, _udpConnection, this);

            _udpConnection.SetTcpConnection(_tcpConnection);
            _manageSendBuffer = new ManageAudioSendBuffer(_udpConnection, this, _maxPositionalDataLength);
            ReadyToConnect    = true;
        }
コード例 #2
0
 public void Close()
 {
     Debug.Log("Closing mumble");
     if (_manageSendBuffer != null)
     {
         _manageSendBuffer.Dispose();
     }
     _manageSendBuffer = null;
     if (_tcpConnection != null)
     {
         _tcpConnection.Close();
     }
     _tcpConnection = null;
     if (_udpConnection != null)
     {
         _udpConnection.Close();
     }
     _udpConnection = null;
     if (_audioDecodeThread != null)
     {
         _audioDecodeThread.Dispose();
     }
     _audioDecodeThread = null;
     Debug.Log("Mumble closed");
 }
コード例 #3
0
 internal MumbleUdpConnection(IPEndPoint host, AudioDecodeThread audioDecodeThread, MumbleClient mumbleClient)
 {
     _host              = host;
     _udpClient         = new UdpClient();
     _audioDecodeThread = audioDecodeThread;
     _mumbleClient      = mumbleClient;
 }
コード例 #4
0
 public DecodedAudioBuffer(AudioDecodeThread audioDecodeThread)
 {
     _audioDecodeThread = audioDecodeThread;
 }
コード例 #5
0
 public DecodingBufferPool(AudioDecodeThread audioDecodeThread)
 {
     _audioDecodeThread = audioDecodeThread;
 }