Aim :
To write a pure javascript based mp3 decoder which supports
MPEG 1 , 2 and Layer 1,2,3
with Id3v2 tags.
Why :
Well This question is huge ! and here is the reason,
1. Since webAudio / mozAudio api's , and the fileReader API the internet browser is becoming an intresting platform for development of really powerful apps
and actually i like where is it going but webAudio and mozAudio both lack the functionality of saving the song as a compressed dataformat , what they deal with is PCM raw, which surely cannot be saved to file and not at all transferred on wire [keep the file size in mind ]
Jussi Kalliokoski's audiolib.js has a proof of concept of saving files
// he converts them to wav and can be saved later.
I wanted to go one step even further and convert them to .mp3 ( because its more widespread & lightweight & supported by all )
secondly mozAudio doesnt even supports the de-coding of mp3 song .
jsMad was a proof of concept ( though very limited ) , which actually de-codes mp3 audio inside a web-browser.
but jsmad is limited to client side and is a pure port of libMAD and lacks qualities with speed :-( no joy!.
2. Server side javascript I dont know if you guys have heard about this but server side javascript is extremely powerful , and by benchmarks node.js 's v8 vm engine actually beats JAVA at speed.
See ( keep in mind the node version there is extremely outdated and node.js has been optimized further )
So i thought it can actually act as a great platform for building web-apps etc. and like php and C++ has got there mp3 conversion libraries , i thought it will be nice to write one for node.js aswell .
3. For the sake of learning .. most of us have used mp3 but do we actually understand what does an mp3 consists of ???
The sad answer for most is no and it was the same for me too before a week , i still have loads to learn though but reading source docs and source codes of Mp3 and libMad has given me a lot of knowledge about mp3 .
Also a libary like this being open will help a lot of developers like me [ i actually wanted to use this for something i am working on already but found no joy ].
3.Road Map
DECODER
1. To read id3v2 - Done
2. To read mp3Frame Header - Done
3. To fetch body / frame - Done
4. To prepare a huffman table [ color= red] Not _ done [/color]
5. To prepare a de-compressor using huffman and convert the audio in huffman form to PCM.
6. VBR [ not necessary but will be cool as awesome ]
ENCODER
----HALTED::Work will begin once decoder is done ----
1. To write id3v2 tags - Done
2. To write mp3FrameHeader Done
3. Strip of unhearable parts using psychoacoustic model
4. Convert to hoffman
5. Write a full frame
Source code ??
Post below if you are intrested i will send you it .
Required Skills
1. Advanced javascript knowledge.
2. knowledge of C++.
3. Eagerness to learn.
4. Will to code more talk less [ hehe trust me this is kinda important as the huffman tables only consist about 80kb ].
So wanna join ? (by the way if somebody is wondering about why i asked here , then um well i know there are loads of curious scratchers out there who have been coding a lot lately in langauges away from scratch aswell ;D , some might get involved in this )
btw the id3v2 reader :: http://gist.github.com/2481696
// Seriously it look quite naive so far
Last edited by fanofcena (2012-04-28 08:50:42)
Offline
ZeroLuck wrote:
I don't think you are allowed to write an MP3-Encoder/Decoder.
Because of license problems. But what about Ogg-vorbis? Ogg vorbis is open source and better than MP3!
How on earth does lame exists ? // you just need to pay a license fees in some countries.
why not ogg-vorbis ,
not widespread , // i am talking about common man.
and
with ogg-vorbis we have .flac a much better audio compression
Last edited by fanofcena (2012-04-28 09:01:50)
Offline
fanofcena wrote:
you just need to pay a license fees in some countries.
That is what I mean.
If you want to pay much money you can do that.
But this is not the only problem:
MP3 is very very complicated! You need very good math skills and
you have to understand much about audio!
I bet you won't finish this project...
But you can try of course.
Last edited by ZeroLuck (2012-04-28 09:19:21)
Offline
ZeroLuck wrote:
fanofcena wrote:
you just need to pay a license fees in some countries.
That is what I mean.
If you want to pay much money you can do that.
But this is not the only problem:
MP3 is very very complicated! You need very good math skills and
you have to understand much about audio!
I bet you won't finish this project...
But you can try of course.
Wanna bet $500 on that ?
// Don't count my scratch projects when u are calibarating me I deleted most of my projects a long while back .
Last edited by fanofcena (2012-04-28 09:53:16)
Offline
ZeroLuck wrote:
I didn't look at your scratch projects.
But you won't finish this project without copying the code from others and don't using finished MP3 librarys...
How can you be so sure about that ?
But yes there is one place where i will have to use other libraries code
the huffman tables :-| for mp3 they are 80kbs alone and i am NOT going to write them by hand.. [removed] NO!
[moderator note - please use appropriate language when using the Scratch Forums
Last edited by Lucario621 (2012-04-28 14:56:57)
Offline