This project has moved and is read-only. For the latest updates, please go here.

Convert WAV to MP3

Jul 29, 2011 at 11:06 PM

Hi all, I'm trying to record sound from my line-in, convert it to MP3 and stream it over the internet.

I got the internet part covered and am at the point of actually grabbing sound of my Line-in. I used the WISAPI method as done in the example application. The problem, though, is in the actual conversion.

When I run the ACM conversion example, I am unable to convert any WAV file at all. The one I recorded using the example mentioned earlier will complain it's not PMC and when I use a perfectly playing WAV file from my music collection, ACM will throw an error I can't find anything about on the internet: acmNotPossible calling acmStreamSize.

I have the latest LAME ACM installed and confirmed it to be working by using VLC streaming, for the record.

Perhaps I'm just taking the hard way, could anyone help getting my chain up and running? I imagine the following: Record line-in to Wav(or other?) MemoryStream -> Encode MemoryStream to Mp3 MemorySystem -> Stream Mp3 MemoryStream to connected sockets

The bold part is already working fine :) The italic parts aren't :( Just to clarify.

All help is greatly appreciated!

Lennard Fonteijn

Sep 6, 2011 at 11:10 AM

ACM is not a particularly easy way of encoding MP3s. I have heard of people using LAME.exe, sending audio data to stdin and reading it out of stdout. This might be a better way of working, but I've not tried it myslelf.

Mark

Nov 1, 2011 at 7:32 PM
Edited Nov 1, 2011 at 7:37 PM

Hello, I know that Boost is able to record mp3 on the fly (Link: http://www.un4seen.com/forum/?topic=4875.0) . I also would like to know if it is possible to do it with NAUDIO.

It is done in BASS through this line (in rectest.c):

BASS_Encode_Start(rchan, "lame --alt-preset standard - bass.mp3", BASS_ENCODE_AUTOFREE,NULL,0)

 

How to do this with NAUDIO?

Thanks