开发者

Where to get pure C++ Lame MP3 encoder - PCM to MP3 example?

So all I need is a simple function that sets it up (eating incoming PCM RATE (for example: rate nea开发者_高级运维r to 44100) It's channels (for example: 2) and -bits (for example: 16) and desirable 128 kb\s rate) and another one that takes PCM data and encodes it into pure MP3 frames.

I know it looks like a silly homework task but I assure you - it is not.

I hope it will be of help to all C++ developers starting with MP3s.

So can anybody please help me with that?


See the example I gave in your other question for the basic usage of Lame. It should contain everything you need.


It's a long time since i messed with this, but Lame lib contains all you need to do it, check out lame.h , there is some test code you could look into.


Personally, I'd be looking at ffmpeg's libavcodec. There's an example file containing an audio_encode_example which ought to be more or less what you're looking for.

See also this question.

Note that not all ffmpeg packagings include mp3 codec support (patent issues) by default, although there's usually some simple way of enabling it.


GStreamer should definitely be able to handle this. If you are on Windows you can use the GStreamer Winbuilds to get started.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜