Exemple #1
0
        public void CanCreateSyncReader()
        {
            var reader = WM.CreateSyncReader(WMT_RIGHTS.WMT_RIGHT_NO_DRM);

            Assert.IsNotNull(reader);
            Marshal.ReleaseComObject(reader);
        }
Exemple #2
0
        private IWMSyncReader OpenWmaFile()
        {
            if (!File.Exists(testWmaFile))
            {
                Assert.Ignore("Test WMA File Not Found");
            }
            IWMSyncReader reader = WM.CreateSyncReader(WMT_RIGHTS.WMT_RIGHT_NO_DRM);

            Assert.IsNotNull(reader);
            reader.Open(testWmaFile);
            return(reader);
        }
Exemple #3
0
 /// <summary>
 /// Create WmaStream with specific format for for uncompressed audio data.
 /// </summary>
 /// <param name="inputStream">Name of asf stream</param>
 /// <param name="OutputFormat">WaveFormat that define the desired audio data format</param>
 public WmaStreamReader(Stream inputStream, WaveFormat OutputFormat)
 {
     m_Reader = WM.CreateSyncReader(WMT_RIGHTS.WMT_RIGHT_NO_DRM);
     try
     {
         m_Reader.OpenStream(new ComStreamWrapper(inputStream));
         Init(OutputFormat);
     }
     catch
     {
         try
         {
             m_Reader.Close();
         }
         finally
         {
             m_Reader = null;
         }
         throw;
     }
 }
Exemple #4
0
 /// <summary>
 /// Create WmaStream with specific format for for uncompressed audio data.
 /// </summary>
 /// <param name="FileName">Name of asf file</param>
 /// <param name="OutputFormat">WaveFormat that define the desired audio data format</param>
 public WmaStreamReader(string FileName, WaveFormat OutputFormat)
 {
     m_Reader = WM.CreateSyncReader(WMT_RIGHTS.WMT_RIGHT_NO_DRM);
     try
     {
         m_Reader.Open(FileName);
         Init(OutputFormat);
     }
     catch
     {
         try
         {
             m_Reader.Close();
         }
         finally
         {
             m_Reader = null;
         }
         throw;
     }
 }