Esempio n. 1
0
        private void buildBlob(byte[] data)
        {
            if (data == null || data.Length < 16)
                return;

            this.raw = data;
            try
            {
                int i = (this.tell ? 1 : 0);

                byte[] pre = new byte[4];
                pre[0] = 0;
                pre[1] = data[i+0];
                pre[2] = data[i+1];
                pre[3] = data[i+2];

                if (BitConverter.ToInt32(pre, 0) == voicePrefix)
                {
                    i += 3;
                    this.style = (VoiceStyle)Enum.Parse(typeof(VoiceStyle), Packet.popString(ref data, ref i).ToString(), true);
                    this.cmd = (VoiceCommand)Enum.Parse(typeof(VoiceCommand), Packet.popString(ref data, ref i).ToString(), true);
                }
            }
            catch (Exception ex)
            {
                System.Diagnostics.Trace.WriteLine(ex.ToString());
            }
        }
Esempio n. 2
0
        public override void SetStyle(VoiceStyle style)
        {
            CurrentStyle = style;

            AudioSource.volume = CurrentStyle.Volume;
            AudioSource.pitch  = CurrentStyle.Pitch;

            switch (CurrentStyle.Effect)
            {
            case VoiceStyle.VoiceEffect.Radio:
                AudioSource.outputAudioMixerGroup = RadioMixerGroup;
                break;

            case VoiceStyle.VoiceEffect.None:
                AudioSource.outputAudioMixerGroup = null;
                break;
            }
            // TODO
        }
Esempio n. 3
0
 public VoiceBlob(VoiceStyle Style, VoiceCommand Command)
 {
     this.style = Style;
     this.cmd = Command;
 }