Sign in to follow this  
rjvereijken

MP3 recording

Recommended Posts

Good day, I'd like to record an MP3 straight from the audio input from a computer, and if possible even cut out some parts. I always thought this would be possible using DirectShow, but I can't find any tutorial or sample about MP3 at all. I am hoping you could point me in the right direction or link me some examples. Thanks in advance.

Share this post


Link to post
Share on other sites
Well, you'd have to capture the input and then encode it into MP3. The encoding part is going to be difficult, I think (especially with MP3).

Share this post


Link to post
Share on other sites
LAME boasts a DirectShow filter, so presumably it's only possible after installing this. I'd guess that encoding in DirectShow is wrapped to be codec-agnostic, so looking for a 'MP3 Encoding DirectShow' example is missing the bigger picture. I've never worked with DirectShow, but by my reckoning any encoding example can be easily adapted to use whatever MP3 codecs are registered.

Otherwise, here is an example of capturing using the Windows API and encoding directly via the LAME API.

Admiral

Share this post


Link to post
Share on other sites
Thank you for your replies. I think the last link you posted is enough to get me started. It doesn't HAVE to be DShow, I just understood it would be the only proper way.

Share this post


Link to post
Share on other sites
If the MP3-encoding becomes a problem, you might consider recording to Ogg-Vorbis format. Many players that support MP3 also support Vorbis, it is (probably) free of any patenting issues and IMHO the Vorbis API is easier to use than DirectShow.
You can find more info on the xiph.org website, including downloads of the libogg and libvorbis libraries.

Share this post


Link to post
Share on other sites
Well we chose mp3 as it needs to be playable on as many devices as possible, like mobile phones, mp3players. I was under the impression that ogg Vorbis is still not that common on these players..

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

Sign in to follow this