Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Class for reading MP3 files

Tags:

c++

decoding

mp3

I am writing a game that is a bit depending on the soundtrack so I want to read mp3 file and use it's data (like the speed of music, beat and stuff). Is there any class (preferably) I could use or article that would cover everything about mp3 reading (from checking if it's an mp3 to actual decoding)? It's OK if I have to do different calculations to find the rhythm and stuff, I just wanna decode file as I don't know the algorithm (and don't know if it's complicated or not).

like image 525
Pijusn Avatar asked Nov 28 '25 00:11

Pijusn


1 Answers

Yes, its complicated. MP3s are the typical lossy DCT compression scheme more or less. The process is similar to JPEG.

Writing an mp3 decoder and encoder is a project in itself.

Encode

Quantize -> DCT Transform -> Entropy Encode -> Store

Decode

Entropy Decode -> IDCT -> Dequantize -> play

I suggest FMOD its widely accepted and used in the gaming community.

like image 158
EnabrenTane Avatar answered Nov 29 '25 13:11

EnabrenTane