Esempio n. 1
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");
 }
Esempio n. 2
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());
        }