tags:

views:

521

answers:

4

So all I need is a simple function that sets it up (eating incoming PCM RATE (for example: rate near 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?

+2  A: 

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.

fn
I'm Loving It!=)
Blender
+1  A: 

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.

timday
+1  A: 

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

StackedCrooked
+1  A: 

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

Mike Seymour
best one I've seen for 6 month!)
Blender