September 20th, 2012, 09:28 PM
Reading in an mp3 file
Hi, I'm trying to read in an mp3 file and for some reason it is not working. I am using Dev++. The mp3 file name is sample.mp3. I put that into the parameters and it keeps giving me an error. Here is that part of the code..
Also is there a way to read different bytes from the binary file? For example, if I wanted to see what the 3rd from last byte of the file is... Is that possble? Thanks a lot.
FILE *f = fopen("sample.mp3", "rb");
if(f == NULL)
printf("\nThere was an error opening the file.\n");
printf(f); //not sure if this works but i want to print the mp3 in binary
September 20th, 2012, 09:56 PM
You need to study more c programming before you try to write difficult programs like this. Sure, I could tell you to investigate fread or fseek, but you're not yet ready for these.
Instead of writing code, use a utility like hexdump . There are a great many programs already available.
Last edited by b49P23TIvg; September 20th, 2012 at 10:10 PM.
[/code] are essential for python code and Makefiles!
September 20th, 2012, 10:02 PM
i know a bit about fread and fseek but i guess you are right for the most part