Пример #1
0
        public AudioInPusher(AudioSessionParameters sessParam, Voice.ILogger logger)
        {
            var t = new Thread(() =>
            {
                try
                {
                    var handle = Photon_Audio_In_CreatePusher(instanceCnt, nativePushCallback, (int)sessParam.Category, (int)sessParam.Mode, sessParam.CategotyOptionsToInt());
                    lock (instancePerHandle)
                    {
                        this.handle     = handle;
                        this.instanceID = instanceCnt;
                        instancePerHandle.Add(instanceCnt++, this);
                    }
                }
                catch (Exception e)
                {
                    Error = e.ToString();
                    if (Error == null) // should never happen but since Error used as validity flag, make sure that it's not null
                    {
                        Error = "Exception in AudioInPusher constructor";
                    }
                    logger.LogError("[PV] AudioInPusher: " + Error);
                }
            });

            t.Name = "IOS AudioInPusher ctr";
            t.Start();
        }
 public AudioInPusher(int deviceID, Voice.ILogger logger)
 {
     this.deviceID = deviceID;
     try
     {
         handle = Photon_Audio_In_CreatePusher(instanceCnt, deviceID, nativePushCallback);
         instancePerHandle.Add(instanceCnt++, this);
     }
     catch (Exception e)
     {
         Error = e.ToString();
         if (Error == null) // should never happen but since Error used as validity flag, make sure that it's not null
         {
             Error = "Exception in AudioInPusher constructor";
         }
         logger.LogError("[PV] AudioInPusher: " + Error);
     }
 }