1

I want to create a program to convert some music files from wav to mp3. WAV should be raw bitstream and reading it shouldn't be much of a problem, but I don't even know where to start with learning how to encode that raw stream into mp3. I've already read how to build up header of mp3 frame, but I'd like to know how exactly are music data stored. As I;m quite new to this stuff, some thorough reference or tutorial would be great (books are welcomed also).

I'd like to point out that existing libraries and usage of codecs are not an option, so I'll need to go into basics and do it for myself. If you present a code itself, I'm preferring c/c++ but I can somehow read through other languages too.

Raven
  • 4,783
  • 8
  • 44
  • 75
  • 2
    Do you want to learn all about the gory details of audio compression, or do you just want to convert files? – Some programmer dude Oct 27 '11 at 11:46
  • 2
    You want to encode raw sound to MP3, but "usage of codecs is not an option"? I don't really understand those requirements. You realize that the invention of the MP3 compression algorithm with its psycho-accoustic component was a major breakthrough, and that it won't just come in a few lines of code? – Kerrek SB Oct 27 '11 at 11:48
  • I'd prefer that what Joachim said, all the details. I understand that it won't be anything easy, but I can't tell if I will be able to understand it if I haven't seen the background yet. Anyway the usage of codecs is not an option because I want put that mess into shaders and see what speed up in conversion I can get. Crazy and maybe unreal task but I got some free time right now ;) – Raven Oct 27 '11 at 12:14

2 Answers2

6

A complete implementation of an MP3 encoder including (actually, only) source code is LAME: http://sourceforge.net/projects/lame/files/lame/3.99/

deceze
  • 510,633
  • 85
  • 743
  • 889
3

This article would help understand internals of MP3, although it is focused on decoding:

http://blog.bjrn.se/2008/10/lets-build-mp3-decoder.html

pocorall
  • 1,247
  • 1
  • 10
  • 24