• 大小: 10.10M
    文件类型: .rar
    金币: 2
    下载: 1 次
    发布日期: 2023-06-24
  • 语言: C/C++
  • 标签: c++  Mp3  编码  

资源简介

这是一个采集PCM数据,并可编码为MP3的例子,编码器为lamp

资源截图

代码片段和文件信息

//Download by http://www.NewXing.com
// mp3_stream.cpp : Defines the entry point for the console application.
//


#pragma setlocale(“.1251“)

#include “stdafx.h“
#include “INCLUDE/mp3_simple.h“
#include “INCLUDE/waveIN_simple.h“
//---------------------------------------
#include “INCLUDE/BladeMP3EncDLL.h“

//----------------------------------------
#include 

// An example of the  implementation.
class mp3Writer: public IReceiver{
private:
CMP3Simple m_mp3Enc;

FILE *f;

public:
mp3Writer(unsigned int bitrate = 128 unsigned int finalSimpleRate = 0): 
m_mp3Enc(bitrate 44100 finalSimpleRate) {
f = fopen(“music.mp3“ “wb“);
if (f == NULL) throw “Can‘t create MP3 file.“;
};

~mp3Writer() {
fclose(f);
};

virtual void ReceiveBuffer(LPSTR lpData DWORD dwBytesRecorded) {
BYTE mp3Out[44100 * 4];
DWORD dwOut;
m_mp3Enc.Encode((PSHORT) lpData dwBytesRecorded/2 mp3Out &dwOut);

fwrite(mp3Out dwOut 1 f);
};
};


 属性            大小     日期    时间   名称
----------- ---------  ---------- -----  ----

    .......    162304  2006-11-10 00:00  www.NewXing.com\mp3_stream_demo\lame_enc.dll

    .......     73728  2006-11-16 13:00  www.NewXing.com\mp3_stream_demo\mp3_stream.exe

    .......        90  2006-11-10 00:00  www.NewXing.com\mp3_stream_demo\start.bat

    .......         0  2007-08-24 09:18  www.NewXing.com\mp3_stream_src\-br

    .......         0  2007-08-24 09:18  www.NewXing.com\mp3_stream_src\-line

    .......         0  2007-08-24 09:18  www.NewXing.com\mp3_stream_src\-sr

    .......         0  2007-08-24 09:18  www.NewXing.com\mp3_stream_src\-v

     文件    4934656  2018-03-19 15:59  www.NewXing.com\mp3_stream_src\Debug\mp3_stream.bsc

     文件       1865  2018-03-19 14:42  www.NewXing.com\mp3_stream_src\Debug\mp3_stream.Build.CppClean.log

     文件     632832  2018-03-19 15:59  www.NewXing.com\mp3_stream_src\Debug\mp3_stream.exe

     文件    1519240  2018-03-19 15:59  www.NewXing.com\mp3_stream_src\Debug\mp3_stream.ilk

     文件       2176  2018-03-19 15:59  www.NewXing.com\mp3_stream_src\Debug\mp3_stream.log

     文件     307963  2018-03-19 15:59  www.NewXing.com\mp3_stream_src\Debug\mp3_stream.obj

     文件    1703936  2018-03-19 14:42  www.NewXing.com\mp3_stream_src\Debug\mp3_stream.pch

     文件    3451904  2018-03-19 15:59  www.NewXing.com\mp3_stream_src\Debug\mp3_stream.pdb

     文件          0  2018-03-19 15:59  www.NewXing.com\mp3_stream_src\Debug\mp3_stream.sbr

     文件        462  2018-03-19 15:59  www.NewXing.com\mp3_stream_src\Debug\mp3_stream.tlog\BscMake.command.1.tlog

     文件        624  2018-03-19 15:59  www.NewXing.com\mp3_stream_src\Debug\mp3_stream.tlog\bscmake.read.1.tlog

     文件        462  2018-03-19 15:59  www.NewXing.com\mp3_stream_src\Debug\mp3_stream.tlog\bscmake.write.1.tlog

     文件       1674  2018-03-19 15:59  www.NewXing.com\mp3_stream_src\Debug\mp3_stream.tlog\cl.command.1.tlog

     文件      27244  2018-03-19 15:59  www.NewXing.com\mp3_stream_src\Debug\mp3_stream.tlog\CL.read.1.tlog

     文件       1634  2018-03-19 15:59  www.NewXing.com\mp3_stream_src\Debug\mp3_stream.tlog\CL.write.1.tlog

     文件       1280  2018-03-19 15:59  www.NewXing.com\mp3_stream_src\Debug\mp3_stream.tlog\link.command.1.tlog

     文件       3614  2018-03-19 15:59  www.NewXing.com\mp3_stream_src\Debug\mp3_stream.tlog\link.read.1.tlog

     文件        774  2018-03-19 15:59  www.NewXing.com\mp3_stream_src\Debug\mp3_stream.tlog\link.write.1.tlog

     文件        189  2018-03-19 15:59  www.NewXing.com\mp3_stream_src\Debug\mp3_stream.tlog\mp3_stream.lastbuildstate

     文件      11422  2018-03-19 14:42  www.NewXing.com\mp3_stream_src\Debug\StdAfx.obj

     文件     104684  2018-03-19 14:42  www.NewXing.com\mp3_stream_src\Debug\StdAfx.sbr

     文件     519168  2018-03-19 15:59  www.NewXing.com\mp3_stream_src\Debug\vc120.idb

     文件     479232  2018-03-19 15:59  www.NewXing.com\mp3_stream_src\Debug\vc120.pdb

............此处省略44个文件信息

评论

共有 条评论