naudio / NLayer

MPEG 1 & 2 Decoder for Layers 1, 2, & 3
MIT License
123 stars 30 forks source link

Write Mp3 files on Linux. #25

Closed richardlatterPBA closed 3 years ago

richardlatterPBA commented 3 years ago

Good Morning all,

I've been using NLayer to read and convert MP3 to wav files with some success. However, the target machine is Linux and I can't see a way of writing MP3 files.

Currently, I have a workaround which uses Sox to do any post processing however, this takes twice as long. I have to write the WAV file then MP3. Is there a way that NLayer can do this?

Also, I need to write some other file formats which are (ulaw, pcm, alaw, wav44k). Does NLayer support this and are there any good examples on how to do this.

Thanks, in advance. R.

basisbit commented 3 years ago

Please provide the source code which doesn't work for you. I don't see why you wouldn't be able to use standard .net framework/mono features to write the converted audio file stream.

richardlatterPBA commented 3 years ago

Please provide the source code which doesn't work for you. I don't see why you wouldn't be able to use standard .net framework/mono features to write the converted audio file stream.

Hello basisbit,

Thanks for your reply.

At the moment, I can only read and convert MP3 files to wav. I do not have any code to write that can convert .wav files to .mp3. If you have any examples it would be very helpful.

Thanks, in advance,

basisbit commented 3 years ago

Oh, then I misunderstood your question.

NLayer is a fully managed MP3 to WAV decoder

NLayer currently has no code at all for converting WAV to MPEG frames or to ulaw/pcm/alaw/wav44k. Imho, that would be a completely different / new project. You might want to look at https://github.com/naudio/NAudio