Example #1
0
        /// <summary>
        /// �G���R�[�_����������܂��B
        /// </summary>
        /// <param name="samplingRate">�T���v�����O���[�g 32000 or 44100 or 48000</param>
        /// <param name="channels">�`�����l���� 1 or 2 </param>
        /// <param name="bitRateInKBPS">�r�b�g���[�g (kBps) 128 �Ƃ� 192 �Ƃ� 320 �Ƃ�</param>
        public LameEncoder(int samplingRate, int channels, int bitRateInKBPS)
        {
            Native.BECONFIG conf = new Native.BECONFIG(samplingRate, channels, bitRateInKBPS);
            uint r = Native.beInitStream(ref conf, out samplesPerChunk, out bufferSize, out stream);

            if (r != 0)
                throw new Exception("Lame�̏������Ɏ��s���������B(" + r + ")");
        }
Example #2
0
 /// <summary>
 /// �`�����N������̃T���v������擾���܂�
 /// </summary>
 /// <param name="samplingRate">�T���v�����O���[�g 32000 or 44100 or 48000</param>
 /// <param name="channels">�`�����l���� 1 or 2 </param>
 /// <param name="bitRateInKBPS">�r�b�g���[�g (kBps) 128 �Ƃ� 192 �Ƃ� 320 �Ƃ�</param>
 /// <returns></returns>
 public static int GetSamplesPerChunk(int samplingRate, short channels, short bitRateInKBPS)
 {
     uint samplesPerChunk, bufferSize, stream;
     Native.BECONFIG conf = new Native.BECONFIG(samplingRate, channels, bitRateInKBPS);
     uint r = Native.beInitStream(ref conf, out samplesPerChunk, out bufferSize, out stream);
     if (r != 0)
         throw new Exception("Lame�̏������Ɏ��s���������B(" + r + ")");
     Native.beCloseStream(stream);
     return (int)samplesPerChunk;
 }
Example #3
0
        /// <summary>
        /// エンコーダを初期化します。
        /// </summary>
        /// <param name="samplingRate">サンプリングレート 32000 or 44100 or 48000</param>
        /// <param name="channels">チャンネル数 1 or 2 </param>
        /// <param name="bitRateInKBPS">ビットレート (kBps) 128 とか 192 とか 320 とか</param>
        public LameEncoder(int samplingRate, int channels, int bitRateInKBPS)
        {
            Native.BECONFIG conf = new Native.BECONFIG(samplingRate, channels, bitRateInKBPS);
            uint            r    = Native.beInitStream(ref conf, out samplesPerChunk, out bufferSize, out stream);

            if (r != 0)
            {
                throw new Exception("Lameの初期化に失敗したっす。(" + r + ")");
            }
        }
Example #4
0
        /// <summary>
        /// チャンクあたりのサンプル数を取得します
        /// </summary>
        /// <param name="samplingRate">サンプリングレート 32000 or 44100 or 48000</param>
        /// <param name="channels">チャンネル数 1 or 2 </param>
        /// <param name="bitRateInKBPS">ビットレート (kBps) 128 とか 192 とか 320 とか</param>
        /// <returns></returns>
        public static int GetSamplesPerChunk(int samplingRate, short channels, short bitRateInKBPS)
        {
            uint samplesPerChunk, bufferSize, stream;

            Native.BECONFIG conf = new Native.BECONFIG(samplingRate, channels, bitRateInKBPS);
            uint            r    = Native.beInitStream(ref conf, out samplesPerChunk, out bufferSize, out stream);

            if (r != 0)
            {
                throw new Exception("Lameの初期化に失敗したっす。(" + r + ")");
            }
            Native.beCloseStream(stream);
            return((int)samplesPerChunk);
        }