public void CanCreateSyncReader() { var reader = WM.CreateSyncReader(WMT_RIGHTS.WMT_RIGHT_NO_DRM); Assert.IsNotNull(reader); Marshal.ReleaseComObject(reader); }
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); }
/// <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; } }
/// <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; } }