コード例 #1
0
ファイル: Mp3Writer.cs プロジェクト: vmail/main
 /// <summary>
 /// Create a Mp3Writer with specific MP3 format
 /// </summary>
 /// <param name="Output">Stream that will hold the MP3 resulting data</param>
 /// <param name="InputDataFormat">PCM format of input data</param>
 /// <param name="Mp3Config">Desired MP3 config</param>
 public Mp3Writer(Stream Output, WaveFormat InputDataFormat, BE_CONFIG Mp3Config, bool isStreamOwner)
     : base(Output, InputDataFormat)
 {
     IsStreamOwner = isStreamOwner;
       try
       {
     m_Mp3Config = Mp3Config;
     uint LameResult = Lame_encDll.beInitStream(m_Mp3Config, ref m_InputSamples, ref m_OutBufferSize, ref m_hLameStream);
     if ( LameResult != Lame_encDll.BE_ERR_SUCCESSFUL)
     {
       throw new ApplicationException(string.Format("Lame_encDll.beInitStream failed with the error code {0}", LameResult));
     }
     m_InBuffer = new byte[m_InputSamples*2]; //Input buffer is expected as short[]
     m_OutBuffer = new byte[m_OutBufferSize];
       }
       catch
       {
     CloseStream();
     throw;
       }
 }
コード例 #2
0
ファイル: Mp3Writer.cs プロジェクト: WildGenie/ispyconnect
 /// <summary>
 /// Create a Mp3Writer with specific MP3 format
 /// </summary>
 /// <param name="output">Stream that will hold the MP3 resulting data</param>
 /// <param name="inputDataFormat">PCM format of input data</param>
 /// <param name="mp3Config">Desired MP3 config</param>
 /// <param name="isStreamOwner"> </param>
 public Mp3Writer(Stream output, WaveFormat inputDataFormat, BE_CONFIG mp3Config, bool isStreamOwner)
     : base(output, inputDataFormat)
 {
     IsStreamOwner = isStreamOwner;
       try
       {
     _mMp3Config = mp3Config;
     uint lameResult = Lame_encDll.beInitStream(_mMp3Config, ref _mInputSamples, ref _mOutBufferSize, ref _mHLameStream);
     if ( lameResult != Lame_encDll.BE_ERR_SUCCESSFUL)
     {
       throw new ApplicationException(string.Format("Lame_encDll.beInitStream failed with the error code {0}", lameResult));
     }
     _mInBuffer = new byte[_mInputSamples*2]; //Input buffer is expected as short[]
     _mOutBuffer = new byte[_mOutBufferSize];
       }
       catch
       {
     CloseStream();
     throw;
       }
 }
コード例 #3
0
ファイル: Mp3Writer.cs プロジェクト: uzbekdev1/ispyconnect
 /// <summary>
 /// Create a Mp3Writer with specific MP3 format
 /// </summary>
 /// <param name="output">Stream that will hold the MP3 resulting data</param>
 /// <param name="inputDataFormat">PCM format of input data</param>
 /// <param name="mp3Config">Desired MP3 config</param>
 /// <param name="isStreamOwner"> </param>
 public Mp3Writer(Stream output, WaveFormat inputDataFormat, BE_CONFIG mp3Config, bool isStreamOwner)
     : base(output, inputDataFormat)
 {
     IsStreamOwner = isStreamOwner;
     try
     {
         _mMp3Config = mp3Config;
         uint lameResult = Lame_encDll.beInitStream(_mMp3Config, ref _mInputSamples, ref _mOutBufferSize, ref _mHLameStream);
         if (lameResult != Lame_encDll.BE_ERR_SUCCESSFUL)
         {
             throw new ApplicationException(string.Format("Lame_encDll.beInitStream failed with the error code {0}", lameResult));
         }
         _mInBuffer  = new byte[_mInputSamples * 2]; //Input buffer is expected as short[]
         _mOutBuffer = new byte[_mOutBufferSize];
     }
     catch
     {
         CloseStream();
         throw;
     }
 }
コード例 #4
0
 /// <summary>
 /// Create a Mp3Writer with specific MP3 format
 /// </summary>
 /// <param name="Output">Stream that will hold the MP3 resulting data</param>
 /// <param name="InputDataFormat">PCM format of input data</param>
 /// <param name="Mp3Config">Desired MP3 config</param>
 public Mp3Writer(Stream Output, WaveFormat InputDataFormat, BE_CONFIG Mp3Config, bool isStreamOwner)
     : base(Output, InputDataFormat)
 {
     IsStreamOwner = isStreamOwner;
     try
     {
         m_Mp3Config = Mp3Config;
         uint LameResult = Lame_encDll.beInitStream(m_Mp3Config, ref m_InputSamples, ref m_OutBufferSize, ref m_hLameStream);
         if (LameResult != Lame_encDll.BE_ERR_SUCCESSFUL)
         {
             throw new ApplicationException(string.Format("Lame_encDll.beInitStream failed with the error code {0}", LameResult));
         }
         m_InBuffer  = new byte[m_InputSamples * 2]; //Input buffer is expected as short[]
         m_OutBuffer = new byte[m_OutBufferSize];
     }
     catch
     {
         CloseStream();
         throw;
     }
 }
コード例 #5
0
 public Mp3WriterConfig(WaveFormat InFormat, BE_CONFIG beconfig)
     : base(InFormat)
 {
     m_BeConfig = beconfig;
 }
コード例 #6
0
 protected Mp3WriterConfig(SerializationInfo info, StreamingContext context)
     : base(info, context)
 {
     m_BeConfig = (BE_CONFIG)info.GetValue("BE_CONFIG", typeof(BE_CONFIG));
 }
コード例 #7
0
ファイル: Lame.cs プロジェクト: uzbekdev1/ispyconnect
 public static extern uint beInitStream(BE_CONFIG pbeConfig, ref uint dwSamples, ref uint dwBufferSize, ref uint phbeStream);
コード例 #8
0
 protected Mp3WriterConfig(SerializationInfo info, StreamingContext context)
     : base(info, context)
 {
     m_BeConfig = (BE_CONFIG)info.GetValue("BE_CONFIG", typeof(BE_CONFIG));
 }
コード例 #9
0
 public Mp3WriterConfig(WaveFormat InFormat, BE_CONFIG beconfig)
     : base(InFormat)
 {
     m_BeConfig = beconfig;
 }
コード例 #10
0
ファイル: Lame.cs プロジェクト: WildGenie/ispyconnect
 public static extern uint beInitStream(BE_CONFIG pbeConfig, ref uint dwSamples, ref uint dwBufferSize, ref uint phbeStream);