fork(1) download
  1. private static IWMStreamConfig CreateAudioConf( IWMProfile wmProfile)
  2. {
  3. IWMProfileManager pProfileManager = null;
  4.  
  5. IWMStreamConfig pFormatCofig = null;
  6. try
  7. {
  8. var WMMEDIATYPE_Audio = new Guid("73647561-0000-0010-8000-00AA00389B71");
  9.  
  10. IWMStreamConfig pStreamConfig;
  11. wmProfile.CreateNewStream(WMMEDIATYPE_Audio, out pStreamConfig);
  12.  
  13.  
  14. NativeMethods.WMCreateProfileManager(out pProfileManager);
  15.  
  16. var m_pCodecInfo = pProfileManager as IWMCodecInfo3;
  17.  
  18. var g_wszVBREnabled = "_VBRENABLED";
  19. m_pCodecInfo.SetCodecEnumerationSetting(WMMEDIATYPE_Audio, 3, g_wszVBREnabled, AttrDataType.BOOL,
  20. BitConverter.GetBytes(true), Marshal.SizeOf(true));
  21.  
  22. var g_wszNumPasses = "_PASSESUSED";
  23. m_pCodecInfo.SetCodecEnumerationSetting(WMMEDIATYPE_Audio, 3, g_wszNumPasses, AttrDataType.DWORD,
  24. BitConverter.GetBytes(1), sizeof(uint));
  25.  
  26. m_pCodecInfo.GetCodecFormat(WMMEDIATYPE_Audio, 3, 0, out pFormatCofig);
  27.  
  28.  
  29.  
  30. var pMediaProps = pFormatCofig as IWMMediaProps;
  31. int dwMediaTypeLength = 0;
  32. pMediaProps.GetMediaType(null, ref dwMediaTypeLength);
  33.  
  34.  
  35. var ppmtDestination = new AMMediaType();
  36. pMediaProps.GetMediaType(ppmtDestination, ref dwMediaTypeLength);
  37.  
  38. int bit;
  39. pFormatCofig.GetBitrate(out bit);
  40.  
  41. pStreamConfig.SetBitrate(bit);
  42.  
  43. pStreamConfig.SetBufferWindow(3000);
  44.  
  45. var pMediaProps2 = pStreamConfig as IWMMediaProps;
  46.  
  47. pMediaProps2.SetMediaType(ppmtDestination);
  48.  
  49. var pPropertyVault = pStreamConfig as IWMPropertyVault;
  50. pPropertyVault.SetProperty(g_wszVBREnabled, AttrDataType.BOOL, BitConverter.GetBytes(true),
  51. Marshal.SizeOf(true));
  52.  
  53. pStreamConfig.SetStreamName("AudioStream1");
  54. pStreamConfig.SetConnectionName("AudioOutput");
  55. pStreamConfig.SetStreamNumber(2);
  56.  
  57. //
  58.  
  59. return pStreamConfig;
  60. }
  61. finally
  62. {
  63. Marshal.ReleaseComObject(pProfileManager);
  64. Marshal.ReleaseComObject(pFormatCofig);
  65. }
  66. }
Compilation error #stdin compilation error #stdout 0s 0KB
stdin
Standard input is empty
compilation info
prog.cs(1,33): error CS0116: A namespace can only contain types and namespace declarations
Compilation failed: 1 error(s), 0 warnings
stdout
Standard output is empty