Click here to Skip to main content
15,889,462 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
Hey everyone!
Recently I learnt how to open and close text files in C with fopen, fclose and how to use fprintf, fscanf etc!
Now I want to open an .mp3 file using C language but it seems a bit difficult!
I tried to work with the mp3 file as if it was a txt file but obviously it didn't work!
I know you can help me!:)
Thank you in advance!
Posted

1 solution

MP3 is definitely a binary file, hence you have to read it (on Windows platform, at least) in binary mode.
However, just reading it won't help you, since it is a bit difficult to interpret the MP3 encoded data (usually you have to use a library[^] for the purpose).
 
Share this answer
 
Comments
MG2011 1-Feb-12 5:28am    
I 've already downloaded an audio library from this site http://www.un4seen.com/ but I still don't know how to use it!:$
Will it be easier if I convert my mp3 file to another audio format such as wav, or will it be exactly the same?
Sergey Alexandrovich Kryukov 1-Feb-12 5:30am    
Sigh...
--SA
Sergey Alexandrovich Kryukov 1-Feb-12 5:31am    
To "convert" it you need to parse it, and you even don't know how to start even having the library...
--SA
Sergey Alexandrovich Kryukov 1-Feb-12 5:32am    
"Exactly the same"? Do you think inventors of audio compression formats are complete idiots? :-)

Sorry, perhaps I did not understand... do you mean "as difficult"? Is your idea to convert using some 3rd-party tool and then use converted file in your code?
Of course WAV is much simpler...

--SA
MG2011 1-Feb-12 5:39am    
Yes that's what I mean...If wav is simpler then I'd better work with that audio format.

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900