示例#1
0
        /// <summary>
        /// Constructs a new audio source.
        /// </summary>
        /// <param name="name"></param>
        /// <param name="sourceId">If sourceId &lt; 0, the audio source is local.</param>
        public AudioSource(string name, int sourceId, int ownerId, bool isMuted, AudioCodecArgs args)
        {
            if (name == null)
            {
                throw new ArgumentNullException("name");
            }
            if (args == null)
            {
                throw new ArgumentNullException("args");
            }
            if (sourceId == 0)
            {
                throw new ArgumentOutOfRangeException("sourceId");
            }
            if (sourceId > 0 && ownerId == 0)
            {
                throw new ArgumentException("ownerId");
            }

            Name          = name;
            Id            = sourceId;
            OwnerId       = ownerId;
            IsMuted       = isMuted;
            CodecSettings = args;
        }
示例#2
0
 public void Deserialize(ISerializationContext context, IValueReader reader)
 {
     Name          = reader.ReadString();
     Id            = reader.ReadInt32();
     OwnerId       = reader.ReadInt32();
     IsMuted       = reader.ReadBool();
     CodecSettings = new AudioCodecArgs(context, reader);
 }
示例#3
0
        public AudioCodec(AudioCodecArgs args)
        {
            if (args == null)
            {
                throw new ArgumentNullException("args");
            }

            this.settings = args;
        }
示例#4
0
 internal AudioSource(string name, int sourceId, int ownerId, AudioCodecArgs args)
     : this(name, sourceId, ownerId, false, args)
 {
 }