Exemple #1
0
        static AudioText()
        {
            AudioText.m_ScrambleTable    = new byte[0x7f];
            AudioText.m_ScrambleTable[0] = 0xfe;
            int num1 = 0;

            while (true)
            {
                byte num2 = AudioText.NextByte(AudioText.m_ScrambleTable[num1]);
                if (num2 == 0xfe)
                {
                    return;
                }
                AudioText.m_ScrambleTable[num1 + 1] = num2;
                num1++;
            }
        }
Exemple #2
0
 public void SetAudioData(string mimeType, byte[] audioData, bool isMpegOrAac)
 {
     this.MimeType      = mimeType;
     this.m_IsMpegOrAac = isMpegOrAac;
     if (audioData == null)
     {
         this.m_AudioData = null;
     }
     else if (this.m_IsMpegOrAac)
     {
         this.m_AudioData = Utils.ConvertToUnsynchronized(this.m_AudioData);
     }
     else
     {
         this.m_AudioData = AudioText.Scramble(this.m_AudioData);
     }
     this.FirePropertyChanged("AudioData");
 }
Exemple #3
0
        public byte[] GetAudioData(AudioScramblingMode audioScramblingMode)
        {
            if (audioScramblingMode == AudioScramblingMode.Default)
            {
                audioScramblingMode = this.m_IsMpegOrAac ? AudioScramblingMode.Unsynchronization : AudioScramblingMode.Scrambling;
            }
            switch (audioScramblingMode)
            {
            case AudioScramblingMode.Unsynchronization:
                return(Utils.ReadUnsynchronized(this.m_AudioData));

            case AudioScramblingMode.Scrambling:
                return(AudioText.Scramble(this.m_AudioData));
            }
            if (this.m_AudioData == null)
            {
                return(null);
            }
            return((byte[])this.m_AudioData.Clone());
        }